Re: web.xml and session timeout

2001-02-09 Thread Kief Morris

John Clark L. Naldoza typed the following on 09:57 AM 2/9/2001 +0800
 session-config
 session-timeout
 5
 /session-timeout
 /session-config
 
 However, I have a session bean with an HttpSessionBindingListener- I
 would think that my valueUnbound() method would get called after 5
 minutes and something printed to the screen, but it doesn't look like
 the session is timing out-

Based upon my limited experience, and having the default setting which
tomcat gives.  I have observed that the sessions are invalidated every
minute, not every second.  And this cycle starts when you start-up the
Tomcat Server.

It does time out, but don't expect it to be timed-out to the nearest
second.  I tried to get a viable explanation on this mailing list, but
it appears no one knows how...;-(

A background thread processes wakes itself every minute and checks
for sessions which are past their due date. It is conceivable that a
session could be expired an entire minute after it "ought" to be. For
99.99% of applications this shouldn't be a problem.

If it is a problem, you can add a Manager tag to your server.xml.
You'll have to experiment a bit, I haven't tested this on Tomcat 3.2.

Manager className="org.apache.tomcat.session.StandardManager"
   checkInterval="60" maxActiveSessions="-1"
   maxInactiveInterval="-1" /

checkInterval is what you're looking for, it's the number of seconds
the background thread sleeps. Setting this too low means your server
will be constantly crunching on this: even when the server is idle or
nearly idle, it will constantly loop over a possibly empty session list.
In other words, don't set this too low unless you really really need it 
and have measured the effects in different situations.

Don't set maxActiveSessions to anything other than -1 unless you
really want users to see an error page when your site gets too much
traffic. maxInactiveInterval is another way of setting the session timeout,
although I haven't looked to see which takes precedence, or whether
it takes seconds or minutes. The -1 setting above is a poor choice.

Kief


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




web.xml and session timeout

2001-02-08 Thread Jason Novotny


I've stuck a web.xml in my WEB-INF/ directory with the following
session timeout set:

session-config
session-timeout
5
/session-timeout
/session-config


However, I have a session bean with an HttpSessionBindingListener- I
would think that my valueUnbound() method would get called after 5
minutes and something printed to the screen, but it doesn't look like
the session is timing out-

Also, how can I query I this value from my web application to
display how long the user has left?

Thanks, Jason


--
Jason Novotny   [EMAIL PROTECTED]
Home: (510) 704-9917Work: (510) 486-8662
NERSC Distributed Computing http://www-didc.lbl.gov




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: web.xml and session timeout

2001-02-08 Thread John Clark L. Naldoza

Jason Novotny wrote:
 
 I've stuck a web.xml in my WEB-INF/ directory with the following
 session timeout set:
 
 session-config
 session-timeout
 5
 /session-timeout
 /session-config
 
 However, I have a session bean with an HttpSessionBindingListener- I
 would think that my valueUnbound() method would get called after 5
 minutes and something printed to the screen, but it doesn't look like
 the session is timing out-
 
 Also, how can I query I this value from my web application to
 display how long the user has left?
 
 Thanks, Jason
 

Based upon my limited experience, and having the default setting which
tomcat gives.  I have observed that the sessions are invalidated every
minute, not every second.  And this cycle starts when you start-up the
Tomcat Server.

It does time out, but don't expect it to be timed-out to the nearest
second.  I tried to get a viable explanation on this mailing list, but
it appears no one knows how...;-(

As for displaying how long the user has left...  A simple JSP+Javascript
trick should do the trip...

The JSP will getMaxInactiveInterval() + any time discrepancy with the
Tomcat Start-up time subtract whatever value for latency and send the
value to a Javascript timer and have it displayed on your client's
browser...;-)


Cheers,


John Clark

-- 
 /) John Clark Naldoza y Lopez   (\
/ )Software Design Engineer II   ( \
  _( (__  Web-Application Development_) )_
 (((\ \  /_Cable Modem Network Management System _\  / /)))
 ( \_/ / NEC Telecom Software Phils., Inc.  \ \_/ )
  \   /  \   /
   \_/  phone: (+63 32) 233-9142 loc. 3112\_/
   /   /  cellphone: (+63 919) 241-4612 \   \
  /   / email: [EMAIL PROTECTED]\   \

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]