javascript

A place for users and developers of the Xataface to discuss and receive support.

javascript

Postby ansuriya » Thu Jul 15, 2010 10:35 pm

How to catach a close event on a website without javascript? How can i catch a close event on a web page without the use of javascript. I have a site that a users has to log in to and from that I have to keep track of if they are logged in or not. My problem now comes when the user has to be marked as logged out. How can I solve the problem that when the browser closes unexpectedly that it then carries out a method that will mark the user as logged out. The log out methods works when the users logs out and then closes the application.
__________________________
market samurai ~ marketsamurai ~ marketsamurai.com
Last edited by ansuriya on Thu Jul 22, 2010 11:59 pm, edited 1 time in total.
ansuriya
 
Posts: 2
Joined: Sun Jul 11, 2010 2:07 am

Re: javascript

Postby shannah » Tue Jul 20, 2010 9:57 am

There's no sure-fire method. All you can really do is keep track of their last request and store the time of it in the database. And if there haven't been any requests in a while you could consider them logged out. You could use AJAX to periodically poll the server to let it know that the page is still opened.

If you don't absolutely need to know if they are logged in, then I probably wouldn't worry about it.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 7 guests

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved