tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David BalaĹžic <david.bala...@comtrade.com>
Subject RE: Tomcat Session issue - Session not expiring on browser close event
Date Mon, 14 Sep 2015 12:36:03 GMT
Kiran Badi wrote:
 
> Is their a way to kill the session after certain period of inactive time
> where user is not doing anything on the site or I need to adjust my timeout
> value ?

The timeout means exactly "kill the session after certain period of inactive time", so the
answer is yes.

Regards,
David

> 
> On Wed, Sep 9, 2015 at 9:34 AM, Christopher Schultz <
> chris@christopherschultz.net> wrote:
> 
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA256
> >
> > Kiran,
> >
> > On 9/7/15 12:54 PM, Kiran Badi wrote:
> > > I have few attributes saved in session they seems to living for
> > > close to 30 minutes which is session timeout in web xml.
> > >
> > > I need to kill the session once the browser closes on the client
> > > side.
> >
> > You need to free server resources, or you want the client to be
> > disconnected from their (old) session?
> >
> > > Is their a way to do it on server side rather than doing via some
> > > kind of ajax handler.
> >
> > Yes and no.
> >
> > If you have the cookie set with no expiration date (the default with
> > Tomcat's container-managed sessions), then the browser will forget the
> > cookie when it closes.
> >
> > If you *do* have an expiration date on your cookies, then AJAX is the
> > only way, and there's no guarantee that the browser is actually going
> > to send that AJAX message when it's closing the page.
> >
> > If you want the serer to kill the session immediately upon browser
> > close (regardless of "expiration" date), your only hope is AJAX, and I
> > can tell you right now you shouldn't bet on that working.
> >
> > > Doing it via ajax means injecting that code in all my jsp's and
> > > have lot many.
> >
> > Sounds like session cookies are the way to go.
> >
> > Perhaps you should think about using a leaner session, and then
> > sessions living for longer than necessary won't be such a big problem.
> >
> > - -chris
> > -----BEGIN PGP SIGNATURE-----
> > Comment: GPGTools - http://gpgtools.org
> >
> >
> iQIcBAEBCAAGBQJV8DVQAAoJEBzwKT+lPKRYG4gP/0qOpYTP5D0xmPVZAaHF
> AhFY
> >
> Guz8sdBXxnfWlYwWYDZMcbtpOjpi91i5N9W42X0oeFTttkXH5Dzvfo7TpYo9OP
> nv
> >
> RRNdQZncehtlH0nZKjU7rnDFkiCUBWr6/LiblJikOMleItCZDfDIUpmakX7mgs+w
> >
> P0Y976SgdIPVxFjlqXc+Pgxnup6t8lFcNmrBPe93Jmb9QxzL1o4qcevdTz7KVdwo
> >
> BRKPHOEAGXTawcJM9E14e2tUa/8J+M7kTovoCkxjK5+VQSi+2k5KDmMDlxEd
> n6iO
> >
> HPSwpvsHxNyWd21rREIQhNfWOADYar5+phw5g+ifGtRxfhbY+cGzD2DzfrsUk
> ZQB
> > +a0iGf9OgQb/wFIONWZbbx1zl6IQTiajZjuKuSfA5CXYDLbnyfsIMQ1Y77tlSZIZ
> >
> ZIw6k2NiRzKgMm54Fnms8ixAGtIHX9j7qGaJvGVQjc0ZxIexsrp9DgzWt6+BmRb
> D
> >
> H7gMmcT/pl4UzI6fSlOm9d8E/PtL3sd7pGQhEwVb4Y9U1Ihq/bHlPHrTsn0I14H3
> >
> UYZpDFKGHHH8I7r7OrBiMFSWICNsNL2c4BgRU/uzTvEivCRrnJBUjzVGtWsYscv
> j
> >
> HwwTxUzIMnUOe+Uc09PDmh231vKhFYIWsdFDR1MFPQfZUZ9MYPe49xxmL
> q0rmo4+
> > tqTv8vYdaMtWWbmd+G6B
> > =tPe/
> > -----END PGP SIGNATURE-----
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@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