You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Paul Wallace <pw...@intelematics.com.au> on 2003/07/08 14:11:06 UTC

session expiry

Hello All,

    A simple one? I have my session defined in a servlet thus:

 

 

HttpSession session = req.getSession();

session.setAttribute("userSession", h); // (h = HashMap)

 

how or where do define session parameters such as expiry? I would
ideally like my session to die when I call a specified method e.g 

 

close() {

 

      // kill my session here

 

} 

or failing that, how do I define a length of time for the session life?

 

Thanks

 

Paul.


Re: session expiry

Posted by Tim Funk <fu...@joedog.org>.
See the servlet specification from java.sun.com.

In particular, session expiration can be set in web.xml.

sessions can also be expired programmatically via its invalidate() method.

Please followup with tomcat-user if you have more questions. This forum is 
for changing the internals of tomcat.

-Tim

Paul Wallace wrote:
> Hello All,
> 
>     A simple one? I have my session defined in a servlet thus:
> 
>  
> 
>  
> 
> HttpSession session = req.getSession();
> 
> session.setAttribute("userSession", h); // (h = HashMap)
> 
>  
> 
> how or where do define session parameters such as expiry? I would
> ideally like my session to die when I call a specified method e.g 
> 
>  
> 
> close() {
> 
>  
> 
>       // kill my session here
> 
>  
> 
> } 
> 
> or failing that, how do I define a length of time for the session life?
> 
>  
> 
> Thanks
> 
>  
> 
> Paul.
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org