You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "PHAM,TAM (HP-Vancouver,ex1)" <ta...@hp.com> on 2001/09/01 00:34:54 UTC

RE: Loggin out using JDBC realms

Taavi:

Thanks for you help.  I have implemeted the call as you suggested when the
user logs out.  

Regarding logging out of JDBC realms.  This does not seem ideal if I have to
explicitly call session.invalidate() when the user logs out.  Do you have
any suggestions for having Jakarta-tomcat automatically invalidating the
session after x period of time.

Tam

-----Original Message-----
From: Taavi Tiirik [mailto:ttaavi@ibs.ee]
Sent: Friday, August 31, 2001 2:12 PM
To: tomcat-user@jakarta.apache.org
Subject: Re: Loggin out using JDBC realms


> when using security realms, more specifically JDBC realms,
> how do you log-out?

Call session.invalidate() and it does the trick.

with best wishes,
Taavi

RE: Loggin out using JDBC realms

Posted by Taavi Tiirik <tt...@ibs.ee>.
On Fri, 31 Aug 2001, PHAM,TAM (HP-Vancouver,ex1) wrote:
> Regarding logging out of JDBC realms.  This does not seem ideal if I
> have to explicitly call session.invalidate() when the user logs out.

Tam,

You can use javascript to fire session.invalidate() in case the
user closes browser window (ie. does not use you log-out link).

And regarding automatic expiration after given period of time
you should be able to put following in your web.xml:

<session-config>
  <session-timeout>30</session-timeout> <!-- timeout in minutes -->
</session-config>

If you want to run your own code in case of automatic session
expiration then I hope this article helps:
http://w6.metronet.com/~wjm/tomcat/2001/Jan/msg00703.html

with best wishes,
Taavi