aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Browser close > session cookie vanishes ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply locked New topic
Author

Browser close > session cookie vanishes ??

Sandeep Vaid
Ranch Hand

Joined: Feb 27, 2006
Posts: 390
HFSJ P-248,

Session cookie vanish when the client's browser quits....

There are 2 things :
1) session objects at server side
2) cookie at client side

If anyone of these vanishes, we can't use the same session again. Right?

I think the statement in bold is incorrect as i have specified the session-timeout as 10 min. I first access the servlet and it prints New Session. Then i closed my broswers window and open it again. then i access the same servlet, it prints old session...
Moreover i can see the cookie object in browsers options....

Also we say that session can expire in these cases
1) Timeout
2) invalidate()

These 2 options also doesn't corresponds to the statement in bold...

I am also aware of the cookie that we can attach to the response and this cookie has nothing to do with session( It's not a session cookie). This cookies timeout is specified by setMaxAge().
Gunnar Maluf
Ranch Hand

Joined: Dec 29, 2007
Posts: 39
Originally posted by Sandeep Vaid:
HFSJ P-248,

Session cookie vanish when the client's browser quits....

There are 2 things :
1) session objects at server side
2) cookie at client side

If anyone of these vanishes, we can't use the same session again. Right?

I think the statement in bold is incorrect as i have specified the session-timeout as 10 min. I first access the servlet and it prints New Session. Then i closed my broswers window and open it again. then i access the same servlet, it prints old session...
Moreover i can see the cookie object in browsers options....

Also we say that session can expire in these cases
1) Timeout
2) invalidate()

These 2 options also doesn't corresponds to the statement in bold...

I am also aware of the cookie that we can attach to the response and this cookie has nothing to do with session( It's not a session cookie). This cookies timeout is specified by setMaxAge().



In your case, the cookie will vanish afer 10 minutes if you specified this. It doesnt matter if the client closes the browser. If you doenst set it a timeout and the client closes the browser then the cookie will vanish.

Correct me if im wrong...

regards
Gunnar


Sun Certified Associate for Java Platform
Sun Certified Java Programmer 5.0
Sun Certified Web Component Developer 5.0
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Sandeep, please do not create duplicate threads.

This conversation can be continued on the other instance of this thread:
http://www.coderanch.com/t/176771/java-Web-Component-SCWCD/certification/Browser-close-session-cookie-vanishes


A good workman is known by his tools.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Browser close > session cookie vanishes ??