Justin Rowles wrote:

>>Usually frames are involved when something like this happens.
>>My involvement with Tomcat is through an IDE I work on, so
>>I haven't done a lot of real world webapp development.  Thus,
>>I don't know why the frames get different sessions.  I would
>>expect them to get the same session as the main page.  When
>>I get a chance, I'll try to do some experimentation and see
>>if there is something that can be done.
>>
>
>If the frame definition has
>
><frameset>
>       <frame1 src="foo.html">
>       <frame2 src="bar.html">
></frameset>
>
>Then both requests are made simultaneously.    The sessions are then both
>started as the requester has not got a cookie (representing session) to send
>back till the first request is answered.  Instead you can do this:
>
><frameset>
>       <frame1 src="foo.html">
>       <frame2 src="blank.html">
></frameset>
>
>Where blank.html is, wait for it, a blank html page.
>
>Then the body tag of foo.html can read 
>
><body onload="javascript: parent.frame2.location='bar.html'">
>
>And the second frame will get the same session because the cookie has been
>set and can now be sent back.
>
>Hope that's clear (and accurate!).
>
>Justin.
>
The funny thing is that when I printed out the session Id of the main 
jsp page and the session Id of one jsp page which sits inside that main 
jsp page, their session Ids are different. How come??

Is there somewhere in TC that I need to configure to allow frames to 
share the same session?

Thanks,
Rong

Reply via email to