> From: André Warnier [mailto:a...@ice-sa.com] 
> Subject: Re: Uploading large files and session timeout

> The do this cleanly, the servlet would need to call 
> HttpSession.getMaxInactiveInterval() at the beginning,
> to save the existing value, then call
> HttpSession.setMaxInactiveInterval() to set a new one 
> for the duration of the transfer, then process the upload,
> then at the end call HttpSession.setMaxInactiveInterval()
> to reset the old value, right ?

Correct, but slightly more complicated due to the previously undisclosed 
possibility of concurrent uploads associated with a single session.

> Since the "session expiration" is determined in function of 
> the MaxInactiveInterval and the lastAccessTime, and since 
> Tomcat has no way to know at the beginning of a request, how 
> long this request will take to process, I would think that the
> lastAccessTime would be updated *at the end* of a request, not
> at the beginning.

Tomcat 7 (which is not what the OP is using) has these system properties to 
control session timeout behavior:

StandardHostValve.ACCESS_SESSION
StandardSession.ACTIVITY_CHECK
StandardSession.LAST_ACCESS_AT_START

(Determining the actions taken for each property setting is left as an exercise 
for the Tomcat documentation reader.)

Tomcat 6 uses only the ACTIVITY_CHECK property, and session expiration is based 
only on when the most recent request arrived - as required by the spec.  The 
properties in Tomcat 7 appear to have been added as workarounds for the 
shortcomings of the spec that you have pointed out.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to