> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's
> Java Servlet API Technology.
> [mailto:[EMAIL PROTECTED] On Behalf Of Sam Seaver
> Sent: Wednesday, March 12, 2003 12:49 PM
> To: [EMAIL PROTECTED]
> Subject: Session length??
>
>
> Dear all,
>
> I have a JSP file that sets the session length to 0, i read
> somewhere that this would mean the session would only expire
> when the browser window is closed.

<sniped>

Here is the extract from the javadocs for HttpSession

<from api docs>
setMaxInactiveInterval
public void setMaxInactiveInterval(int interval)Specifies the time, in
seconds, between client requests before the servlet container will
invalidate this session. A negative time indicates the session should
never timeout.
Parameters:
interval - An integer specifying the number of seconds
</from api docs>

I believe you are setting the timeout to zero, you are actually
invalidating the session. Try to use a -ve value for the timeout.
All session expire when the browser windows are closed. The time out
functionality is to make the sessions and related data expire on the
server side. It would not be a good idea not to have a session timeout,
as after sometime, the server will slowdown and crash because of hanging
sessions.



Rgds,
Gokul



> anyone?
> S
>
> _________________________________________________________________

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to