File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Doubt in session handling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Doubt in session handling" Watch "Doubt in session handling" New topic

Doubt in session handling

Nitin Vashishtha
Ranch Hand

Joined: Mar 26, 2008
Posts: 31
Hello Ranchers,
on page 199,HFSJ,it is mentioned that the client can open a new browser window and the container can use the same session for the request from this new browser window.
So that means that the session cookie which was stored on the first browser,will be used by all the subsequent browsers requests?
and the cookie will be killed only when all the instances of the browsers will be closed?(since I think the cookie will be killed when we close the browser,in case of single instance of browser making the request).
Could someone clarify how the browsers haldle with the session cookie.



SCJP 91%, TOFAG 9 certified 89%
Rhett Wang

Joined: Apr 03, 2008
Posts: 12
Good question!

I have found this fact in my work.
In IE, we can use Ctrl+ N to open a new window, and the new window will keep the same session.
But It seems that FireFox does not work like this.

BTW,I think we should do some research about the difference of Tab and Window.

Hope to get more infomations.

SCBCD in progress<br />SCWCD 5 (May 2008)<br />SCJP 2 (Aug 2001)
Nitin Vashishtha
Ranch Hand

Joined: Mar 26, 2008
Posts: 31
Thanks for your reply Wang.
You are correct,it keeps the same session if we open a new window using ctrl+N,but if we open a new window from outside,it wont keep the cookie information,and that request will not be treated as a part of the session.
Also,in case of URL Rewriting,even if we open a new window from outside ,and we copy and paste the url from the main browser window,it will keep the session,since now we are passing the session-id information in the url itself.


SCJP 91%
I agree. Here's the link:
subject: Doubt in session handling
It's not a secret anymore!