LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Apache - Tomcat How to use session ID to confirm an active user session? (https://www.linuxquestions.org/questions/linux-server-73/apache-tomcat-how-to-use-session-id-to-confirm-an-active-user-session-760330/)

klroller 10-07-2009 10:09 AM

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

acid_kewpie 10-08-2009 03:24 AM

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.

klroller 10-08-2009 07:00 AM

Thanks Chris,

Edit done.

Kerry

chrism01 10-08-2009 07:55 PM

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.

klroller 10-08-2009 09:43 PM

Thanks for your reply
 
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.

Best regards,

KR


All times are GMT -5. The time now is 03:33 PM.