tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dies Koper <d...@jp.fujitsu.com>
Subject Re: Persistent session after browser restart, cookie expiration
Date Tue, 12 Sep 2006 05:59:59 GMT
Hello Heiko,

I think you're looking for the following method:
javax.servlet.http.Cookie#setMaxAge(int expiry)

Its default value (see getMaxAge()) is -1 => the cookie persists until 
browser shutdown.

Regards,
Dies


Heiko Klein wrote:
> Hi,
> 
> I'm currently moving an web-application from custom-made to 
> tomcat-servlet. Before, I used my own cookie management to store 
> user-preferences. The cookies had a persistence on the browser of 1 
> year, if the browser-configuration allowed that.
> 
> The default tomcat cookies for session-management seem to be deleted 
> with browser-restart. How can I keep a session open even if the user 
> restarts his computer? Or in other words, how can I set the 'Expires' 
> field of the session-cookie send to the browser?
> 
> Best regards,
> 
> Heiko


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message