This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HELP!!!

 
Anthony Smith
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Joe Gilvary
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Anthony Smith
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The server has no way of knowing for sure when a browser is closed or a connection lost without something - Javascript or applet - running on the browser. You could have a "heartbeat" applet making a periodic call to the servlet and a timer to detect when it fails to check in.
NEVER title a message "HELP!!!" it does not tell a thing about what you need help with and wastes everybody's time. "Help with browser closing" would have been good.
Bill
 
Zac Roberts
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
sameera kocharekar
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic