I am in BIG Trouble. I got an app using jsp's and Servlets... When A user logs on, and then closes the browser, I want them to be logged off. I cant wait for anytime out function, unless there is one that constantly checks for something. I need this because a user cannot do multiple logins and your second login cannot log you off of your first login. I got that part working. But if I log in close the browser and then try to login somewhere else, I should be able to, btu I cannot cause while I chek for a session, my db has not way of knowign a user has logged off. Can someone please help
You need to force users to log out, or run a very short timeout on the session. The short time out will be more trouble than it solves. When a user tries to log into a second session, can you display a prompt that lets them log out of the previous session if they did not log out? HTH, Joe
Joined: Sep 10, 2001
I understand what you are saying, but if they close their browser before logging out, they cant go back to log out. I need something, where if they try and close that browser it logs them out automaticaly, or asks them to log out. If they try and login while already login I have that message, but they cant go back to logoff.
Are you running your application on Tomcat? If so there is a sort of built in login session tracking device. It password protects certain files that you specify and whenever a user tries to access them from a "fresh" browser or a new session they are required to login at a designated login screen. It seems to work on a small database app that I am running. I learned about it in Wrox's "Beginning JSP Web Development". Hope that helps.
Hi Why dont u use a cookies.I mean set cookie with maxage as 0 so that when the user closes the browser the cookies expires ie gets deleted. So when he agains logs in with another browser he would be asble to de so.. Sam