tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kirill Kireyev <kir...@instagrok.com>
Subject Re: how to programmatically expire inactive sessions?
Date Tue, 09 Oct 2012 16:22:19 GMT
I think I figured it out. It seems /manager/text/expire only lists the 
expiration info, instead of expiring sessions. Also, wget wasn't 
authenticating me properly. Instead I used curl against the html interface:
     curl --anyauth -u xxx:yyy --data "idle=20" -d path=/zzz 
http://localhost:8080/manager/html/expire

Though I'm still not sure why my sessions aren't expiring automatically...

-Kirill

On 10/7/12 6:46 PM, Kirill Kireyev wrote:
> Hi,
>
> I'm trying to force expirations of inactive sessions in Tomcat. (For 
> some reason, sessions that are inactive longer than timeout don't 
> expire automatically - not sure why?)
>
> I can do it just fine, from the Tomcat Manager web app, by clicking 
> the "Expire Sessions" button.
>
> I've tried doing it programmatically by using 
> "http://localhost:8080/manager/text/expire?path=/zzz" from a script 
> running on the server:
>     wget -O /dev/stdout --http-user=xxx --http-password=yyy 
> "http://localhost:8080/manager/text/expire?path=/zzz"
>
> (I made sure that Tomcat user xxx has manager-script permissions). I 
> get the following output:
>
> K - Session information for application at context path /grok
> Default maximum session inactive interval 20 minutes
> <1 minutes: 9 sessions
> 1 - <2 minutes: 8 sessions
> 2 - <3 minutes: 11 sessions
> 3 - <4 minutes: 4 sessions
> 4 - <5 minutes: 6 sessions
> 5 - <6 minutes: 5 sessions
> 6 - <7 minutes: 9 sessions
> 7 - <8 minutes: 5 sessions
> 8 - <9 minutes: 11 sessions
> 9 - <10 minutes: 7 sessions
> 10 - <11 minutes: 10 sessions
> 11 - <12 minutes: 7 sessions
> 12 - <13 minutes: 6 sessions
> 13 - <14 minutes: 5 sessions
> 14 - <15 minutes: 9 sessions
> 15 - <16 minutes: 7 sessions
> 16 - <17 minutes: 9 sessions
> 17 - <18 minutes: 6 sessions
> 18 - <19 minutes: 9 sessions
> >=20 minutes: 666 sessions
>
> but when I check with the Tomcat Web manager app in my web browser, I 
> still see a lot of unexpired sessions (older than inactive interval) - 
> which I can then manually expire, by clicking "Expire Sessions" button 
> in the web app!
>
> How can i do this automatically? (And/or why don't they expire 
> automatically anyway)?
>
> Thanks,
> Kirill
>
>
>
> -- 
> *Kirill Kireyev, PhD*
> Founder/CTO instaGrok.com <http://www.instagrok.com>
> kirill@instagrok.com
> Twitter: @instaGrok <http://twitter.com/InstaGrok>
> FB: facebook.com/instagrok <http://www.facebook.com/instagrok>
> <http://www.instagrok.com>


-- 
*Kirill Kireyev, PhD*
Founder/CTO instaGrok.com <http://www.instagrok.com>
kirill@instagrok.com
Twitter: @instaGrok <http://twitter.com/InstaGrok>
FB: facebook.com/instagrok <http://www.facebook.com/instagrok>
<http://www.instagrok.com>

Mime
View raw message