Apache - Tomcat How to use session ID to confirm an active user session?
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Apache - Tomcat How to use session ID to confirm an active user session?
Apache – Tomcat
We have a webapp which includes a MySQL log table of the user’s log on and log off activity. If the user closes the webapp by using the webapp “Log Off” button, the webapp will update the MySQL log table with the timestamp of the logoff. If the user closes the browser without using the webapp “Log Off” button the time stamp is not written at exit. We have a maximum idle time for a session; after it expires the webapp session is closed.
We capture the session id in our log file.
Question: Could a program using the session id, check CentOS to see if the session is still active? If this is possible,we could detect expired sessions and then write the logoff time into the webapp log file.
Your comments and suggestions are appreciated.
Thanks
Last edited by klroller; 10-08-2009 at 06:59 AM.
Reason: Feedback- Recommendation to Edit Title
this is clearly nothing to do with CentOS at all, that's just the operating system. You might want to change the thread title to be about tomcat and your own code, not centos.
I think that your main problem is going to be that http is a stateless protocol, so 'active' isn't really a state option. I guess you could have your page have a timer loop in JS that 'pings' ie sends a msg to your server every so often, but that's more network load and I'm not sure if that would also affect the user.
NB: I'm not a web programmer, so take the latter sentence with a pinch of salt.
Thanks for your reply. My programming team has not come with an answer. So I thought asking for a cross section of opinions would be helpful.
I appreciate you taking the time to consider the issue and reply.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.