Re: [OT?] control of session timed out with tomcat

2011-10-21 Thread André Warnier
Mark Thomas wrote: On 20/10/2011 17:01, Tim Watts wrote: On Thu, 2011-10-20 at 16:35 +0100, Mark Thomas wrote: On 20/10/2011 16:22, André Warnier wrote: Hassan Schroeder wrote: On Thu, Oct 20, 2011 at 7:52 AM, André Warnier a...@ice-sa.com wrote: 1) Tomcat (probably) doesn't spend its time

Re: [OT?] control of session timed out with tomcat

2011-10-21 Thread Mark Thomas
On 21/10/2011 10:05, André Warnier wrote: I am assuming that at each access to the application, Tomcat updates the expiration time of the session if any (that is, it sets a new date/time at which this session will be considered as expired, being now + timeout). Rather than making incorrect

Re: [OT?] control of session timed out with tomcat

2011-10-21 Thread André Warnier
Mark Thomas wrote: On 21/10/2011 10:05, André Warnier wrote: I am assuming that at each access to the application, Tomcat updates the expiration time of the session if any (that is, it sets a new date/time at which this session will be considered as expired, being now + timeout). Rather than

Re: [OT?] control of session timed out with tomcat

2011-10-21 Thread Mark Thomas
On 21/10/2011 11:42, André Warnier wrote: Allright, so how about a half-way house to start with ? Keep the list in some thread-safe table, indexed by session-id, and just scan the table. Updating the corresponding session entry at each request should be cheap. Of course in all this, my

Re: [OT?] control of session timed out with tomcat

2011-10-21 Thread André Warnier
Mark Thomas wrote: On 21/10/2011 11:42, André Warnier wrote: Allright, so how about a half-way house to start with ? Keep the list in some thread-safe table, indexed by session-id, and just scan the table. Updating the corresponding session entry at each request should be cheap. Of course in

Re: [OT?] control of session timed out with tomcat

2011-10-21 Thread Mark Thomas
On 21/10/2011 13:43, André Warnier wrote: Mark Thomas wrote: On 21/10/2011 11:42, André Warnier wrote: Allright, so how about a half-way house to start with ? Keep the list in some thread-safe table, indexed by session-id, and just scan the table. Updating the corresponding session entry

Re: [OT] control of session timed out with tomcat

2011-10-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tim, On 10/20/2011 7:01 PM, Tim Watts wrote: This was a while ago -- no HttpSessionListeners available -- so we couldn't easily persist the session and recall it when the user logged in again. Wow. What were you using, Apache JServ? Tomcat 3.x?

Re: [OT] control of session timed out with tomcat

2011-10-21 Thread Tim Watts
On Fri, 2011-10-21 at 11:05 -0400, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tim, On 10/20/2011 7:01 PM, Tim Watts wrote: This was a while ago -- no HttpSessionListeners available -- so we couldn't easily persist the session and recall it when the user

Re: [OT] control of session timed out with tomcat

2011-10-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tim, On 10/21/2011 2:10 PM, Tim Watts wrote: On Fri, 2011-10-21 at 11:05 -0400, Christopher Schultz wrote: On 10/20/2011 7:01 PM, Tim Watts wrote: This was a while ago -- no HttpSessionListeners available -- so we couldn't easily persist the

Re: [OT?] control of session timed out with tomcat

2011-10-21 Thread André Warnier
Mark Thomas wrote: ... Of course in all this, my basic assumption is that currently, Tomcat keeps session information (including the expiration data) in some location which requires an I/O action to access. That assumption is incorrect. Which pretty much invalidates the rest of the points

control of session timed out with tomcat

2011-10-20 Thread Alejandro Soto
Hi my friends, I want to ask you all, If there is a way to control the timed out of sessions with tomcat, what I need is when the session timed out, automatically the user is redirected to the login page, Is this possible to do that from tomcat?, I mean, tomcat triggers some event to the user with

Re: control of session timed out with tomcat

2011-10-20 Thread Tim Watts
On Thu, 2011-10-20 at 09:51 -0400, Alejandro Soto wrote: Hi my friends, I want to ask you all, If there is a way to control the timed out of sessions with tomcat, what I need is when the session timed out, automatically the user is redirected to the login page, Is this possible to do that from

Re: control of session timed out with tomcat

2011-10-20 Thread Hassan Schroeder
On Thu, Oct 20, 2011 at 6:51 AM, Alejandro Soto smalejan...@gmail.com wrote: Hi my friends, I want to ask you all, If there is a way to control the timed out of sessions with tomcat, what I need is when the session timed out, automatically the user is redirected to the login page, Is this

Re: control of session timed out with tomcat

2011-10-20 Thread Tim Watts
On Thu, 2011-10-20 at 10:06 -0400, Tim Watts wrote: On Thu, 2011-10-20 at 09:51 -0400, Alejandro Soto wrote: Hi my friends, I want to ask you all, If there is a way to control the timed out of sessions with tomcat, what I need is when the session timed out, automatically the user is

Re: control of session timed out with tomcat

2011-10-20 Thread Tim Watts
On Thu, 2011-10-20 at 07:08 -0700, Hassan Schroeder wrote: On Thu, Oct 20, 2011 at 6:51 AM, Alejandro Soto smalejan...@gmail.com wrote: Hi my friends, I want to ask you all, If there is a way to control the timed out of sessions with tomcat, what I need is when the session timed out,

Re: control of session timed out with tomcat

2011-10-20 Thread Alejandro Soto
Hi, thanks for your replies, These are the only ways I have to do it?, I was reading something about filters, but I think only works with user interaction. Thanks. On Thu, Oct 20, 2011 at 10:08 AM, Hassan Schroeder hassan.schroe...@gmail.com wrote: On Thu, Oct 20, 2011 at 6:51 AM, Alejandro

Re: control of session timed out with tomcat

2011-10-20 Thread Tim Watts
On Thu, 2011-10-20 at 10:23 -0400, Alejandro Soto wrote: Hi, thanks for your replies, These are the only ways I have to do it?, I was reading something about filters, but I think only works with user interaction. Basically, that's all. Filters are only active during the request-response

Re: control of session timed out with tomcat

2011-10-20 Thread André Warnier
Alejandro Soto wrote: Hi, thanks for your replies, These are the only ways I have to do it?, I was reading something about filters, but I think only works with user interaction. The basic issues are these : 1) Tomcat (probably) doesn't spend its time all the time scanning stored sessions to

Re: control of session timed out with tomcat

2011-10-20 Thread Hassan Schroeder
On Thu, Oct 20, 2011 at 7:52 AM, André Warnier a...@ice-sa.com wrote: 1) Tomcat (probably) doesn't spend its time all the time scanning stored sessions to see if one has expired, and deleting it. Actually, it does. That's what session listeners depend on. So, for example, I can have a

Re: [OT?] control of session timed out with tomcat

2011-10-20 Thread André Warnier
Hassan Schroeder wrote: On Thu, Oct 20, 2011 at 7:52 AM, André Warnier a...@ice-sa.com wrote: 1) Tomcat (probably) doesn't spend its time all the time scanning stored sessions to see if one has expired, and deleting it. Actually, it does. That's what session listeners depend on. So, for

Re: [OT?] control of session timed out with tomcat

2011-10-20 Thread Mark Thomas
On 20/10/2011 16:22, André Warnier wrote: Hassan Schroeder wrote: On Thu, Oct 20, 2011 at 7:52 AM, André Warnier a...@ice-sa.com wrote: 1) Tomcat (probably) doesn't spend its time all the time scanning stored sessions to see if one has expired, and deleting it. Actually, it does. That's

Re: control of session timed out with tomcat

2011-10-20 Thread Alejandro Soto
Thanks for the clarification. Well, my system is like a ERP, what I want to do is basically: the user for work with the system, first must to be authenticated, then the user can works normally, then, if his session timed out, he need to relogin, that is the reason because I need to control the

Re: [OT?] control of session timed out with tomcat

2011-10-20 Thread Tim Watts
On Thu, 2011-10-20 at 16:35 +0100, Mark Thomas wrote: On 20/10/2011 16:22, André Warnier wrote: Hassan Schroeder wrote: On Thu, Oct 20, 2011 at 7:52 AM, André Warnier a...@ice-sa.com wrote: 1) Tomcat (probably) doesn't spend its time all the time scanning stored sessions to see if one

Re: [OT?] control of session timed out with tomcat

2011-10-20 Thread Mark Thomas
On 20/10/2011 17:01, Tim Watts wrote: On Thu, 2011-10-20 at 16:35 +0100, Mark Thomas wrote: On 20/10/2011 16:22, André Warnier wrote: Hassan Schroeder wrote: On Thu, Oct 20, 2011 at 7:52 AM, André Warnier a...@ice-sa.com wrote: 1) Tomcat (probably) doesn't spend its time all the time

Re: control of session timed out with tomcat

2011-10-20 Thread Hassan Schroeder
On Thu, Oct 20, 2011 at 8:35 AM, Alejandro Soto smalejan...@gmail.com wrote: Well, my system is like a ERP, what I want to do is basically: the user for work with the system, first must to be authenticated, then the user can works normally, then, if his session timed out, he need to relogin,

Re: control of session timed out with tomcat

2011-10-20 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tim, On 10/20/2011 10:15 AM, Tim Watts wrote: I should also point out that this approach is somewhat kludgey because of the inherent latency problems when the session is close to expiration. But I don't know of a rock solid approach. You just

Re: [OT?] control of session timed out with tomcat

2011-10-20 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mark, On 10/20/2011 11:35 AM, Mark Thomas wrote: On 20/10/2011 16:22, André Warnier wrote: Or is there a smarter algorithm implemented there ? Such as? I'm open to ideas here (maybe not for this exact problem but certainly the general one). I

Re: control of session timed out with tomcat

2011-10-20 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Alejandro, On 10/20/2011 11:35 AM, Alejandro Soto wrote: Well, my system is like a ERP, what I want to do is basically: the user for work with the system, first must to be authenticated, then the user can works normally, then, if his session timed

Re: control of session timed out with tomcat

2011-10-20 Thread Tim Watts
On Thu, 2011-10-20 at 16:44 -0400, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tim, On 10/20/2011 10:15 AM, Tim Watts wrote: I should also point out that this approach is somewhat kludgey because of the inherent latency problems when the session is close