The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Rajkamal Pillai wrote:According to my understanding Tomcat checks for session timeouts in intervals. Then the server should timeout around the set interval (web.xml). Or does Tomcat check for this timeout interval when it receives each new request?
Rajkamal Pillai wrote:The issue I face is that the User is not logged off after the timeout duration.
Paul Clapham wrote:
Rajkamal Pillai wrote:According to my understanding Tomcat checks for session timeouts in intervals. Then the server should timeout around the set interval (web.xml). Or does Tomcat check for this timeout interval when it receives each new request?
I don't know how Tomcat does that but... if I were designing a system like this, I wouldn't be checking sessions every X minutes to see if they had expired. I would just check a session when a related request came in, and expire the session if it had timed out then. But that's just me. Perhaps you could mention where your understanding came from?
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Tim Holloway wrote:How do you determine that the user has logged out? There are no login/logout events in JEE.
Paul Clapham wrote:
I don't know how Tomcat does that but... if I were designing a system like this, I wouldn't be checking sessions every X minutes to see if they had expired. I would just check a session when a related request came in, and expire the session if it had timed out then. But that's just me. Perhaps you could mention where your understanding came from?
Ron McLeod wrote:
Rajkamal Pillai wrote:The issue I face is that the User is not logged off after the timeout duration.
You should be able to get notifications of expiring sessions by registering a HttpSessionListener. It will be called just after a session has been created (sessionCreated()), and just before a session is to be invalidated (sessionDestroyed()).
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Rajkamal Pillai wrote:Well I am working with a web application. SO once the session has been invalidated the user would be redirected to the login screen?
Paul Clapham wrote:
Rajkamal Pillai wrote:Well I am working with a web application. SO once the session has been invalidated the user would be redirected to the login screen?
That's a reasonable way to test that a session has expired. Of course you would first have to make no accesses to the web server for a time exceeding the supposed time-out settings, and only then send a request to test whether it is redirected to the login screen.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Rajkamal Pillai wrote:The issue I face is that the value set through does not have appear to have much effect.
Remember reading that the timeout value will be defaulted to the value in web.xml (by a Tomcat process?).
Am I correct and is there any way around this?
Paul Clapham wrote:Is your problem that users are logged out based on the default rather than the override, or that they aren't logged out at all if there's an override, or something else?
Paul Clapham wrote:It looks like I totally don't understand your question at all. What's this "User" object you're talking about? (I don't see anybody in the thread mentioning such a thing.) And what's this login process which requires an unconscionable amount of time to run? (I don't see anything about that in the thread either.) So I'm confused. I thought the question was about how to modify the interval before the server times out a session.
Paul Clapham wrote:
Rajkamal Pillai wrote:According to my understanding Tomcat checks for session timeouts in intervals. Then the server should timeout around the set interval (web.xml). Or does Tomcat check for this timeout interval when it receives each new request?
I don't know how Tomcat does that but... if I were designing a system like this, I wouldn't be checking sessions every X minutes to see if they had expired. I would just check a session when a related request came in, and expire the session if it had timed out then. But that's just me. Perhaps you could mention where your understanding came from?
Rajkamal Pillai wrote:My question is about how to modify the timeout interval dynamically, other than by making changes to web.xml. What worries me is my suggested solution should not cause performance and/or usability side effects.
Paul Clapham wrote: It seems like you don't need to extend the timeout interval for everybody, only for some people. If that's not the case and everybody should have an equally extended timeout interval, then just configure that interval into the server.
Paul Clapham wrote: Otherwise, you're going to need a User object to assign a specified timeout interval for each person who has their timeout interval extended. You'd assign this interval when they sign in and there's no need to do it at any other time. Neither do you need a notification when the server times out. So this requires one message from client to server when the user signs in, without any requirement for the user to do anything. So there's no "usability side effect". If this counts as a "performance side-effect" then you need to go to the person saying that and suggest they start being realistic.
Paul Clapham wrote: Perhaps I've missed some of your requirements. I'm assuming you don't want security side-effects like allowing the user to leave the session signed in for a long period of time while they are absent from the computer.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Rajkamal Pillai wrote:My default session timeout value is set to 30 in web.xml, so -
I understand that this is applicable across all user sessions.
Rajkamal Pillai wrote:... my issue is that Users are logged off after (the default) 30 seconds.
Does not have any effect at all.
Rajkamal Pillai wrote:My question is about how to modify the timeout interval dynamically, other than by making changes to web.xml. What worries me is my suggested solution should not cause performance and/or usability side effects.
Rajkamal Pillai wrote:I am on Tomcat 9.0.76
Can you kindly advice what version I should look to upgrade to?
Rajkamal Pillai wrote:
I mean the User logs in - he/she (scared about the pronouns, here) gets validated against a database, the "User" object gets loaded - their timeout settings get loaded - setMaxInactiveInterval() is invoked - and they gotabout doing whatever business they care for. I might have an admin level user but I think that is irrelevant at this point.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Rajkamal Pillai wrote:
I'm not really sure what kinds of performance/usabilities issues you might be thinking of. Can you give some examples?
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
He repaced his skull with glass. So you can see his brain. Kinda like this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|