wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes keep session alive after browser is closed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "keep session alive after browser is closed" Watch "keep session alive after browser is closed" New topic
Author

keep session alive after browser is closed

J You
Greenhorn

Joined: Jul 31, 2001
Posts: 29
We have the application with a typical login
page, and once the user logs on, some user
data will be saved in session attributes.
Now, I was asked to add such a feathure:the user
only want to login for one time every day.The
other times the user can go directly to the menu,
even after "close and then restart the browser".
I set the session time-out variable to be a
pretty big number.I found once the browser
is closed, the session is still alive(getSession(false)!=null),
but the session attributes have all been lost.
Is there any way to keep the session attributes
after the browser is closed?
I test the application with Tomcat3.3,and my
production server doesn't support Session Listener.
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
Setting the Session timeout to be very large will not work. After the browser is closed (for IE at least) all session cookies get destroyed. Therefore, the next visit will result in a new session being used.
You need to write a persistant cookie and then check for this cookie everytime the user visits. This is a standard industry technique.
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
BTW, this is probably better off in the Servlets or JSP Forums.
[ November 12, 2002: Message edited by: Chris Mathews ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: keep session alive after browser is closed