This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
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.
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.
Joined: Jul 18, 2001
BTW, this is probably better off in the Servlets or JSP Forums. [ November 12, 2002: Message edited by: Chris Mathews ]
subject: keep session alive after browser is closed