Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logging off from website

Status
Not open for further replies.

Jaheel22

Technical User
Jul 14, 2004
84
US
I have a website developed in ASP. When user logs off the website by using log off hyperlink / button on the web page, a flag is set in user's record in the database to
indicate user is now logged off. But if user just closes the browser instead of using log off hyperlink / button, flag in the user's record cannot be updated.

Is there some way / some technique i can capture the event or detect that user has closed browser / ended session and then i can update user's record ?

Please note i'm not allowed to use cookies or session variables.

Thank you.
 
Please note i'm not allowed to use cookies or session variables.
Then you can't

How do you keep the user logged in without using cookies or sessions ???



Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
When user logs in, i set a flag in user's record in database which indicates users is now logged in. This flag is validated / checked on every page to see if user is logged in, if not, then user is redirected to login page.

Thank you
 
I think you are missing the point of the question we need in order to help you so I'll try to make it clear

How do you track the users now?



General FAQ faq333-2924
5 steps to asking a question faq333-3811
 
When user logs in, after validating his credentials, i grab userid of user and pass it from page to page and verify it on each page and also check logged-in flag in user's record in the database.
 
Perhaps you can make a change to the method you use to keep track of logged in users.

Instead of storing a flag, store a timestamp and a flag. Modify your function that checks to see if a user is logged in to see if the user was logged in within the last 10 minutes AND the flag is set. If they are logged in, update the record with a new timestamp.

If they explicitly log off, then set the flag to off. Now they won't pass the flag = On and Timestamp < 10 minutes old, so they would have to log back in.

If they don't log off, then after 10 minutes they won't pass flag = On and Timestamp < 10 minutes old, so they would have to log back in.


Bonus: You now have a field to tell you when the last time aeach user accessed the site :)

-T

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top