Re: OnBeforeUnload Event

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Ricky Chan said the following on 4/26/2006 10:44 PM:
Actually, the location.replace will redirect to the page logout.asp.

Then you are depending on a bug in a browser. If the browser is closing then how do you think it should access a new page? That would be *very* annoying to say the least. I left, leave me be. I bet it works real good when you navigate away. A user clicks a link or uses a Favorites or types in a URL to go elsewhere and you redirect them to your own page instead of where I went. Real user friendly.

Use sessions and timeouts of sessions - problem solved.

logout.asp will abandon the sesson and update the user logout time to the DB.

If you say so, I don't agree.

We want to record the user logout time when user click the X button on the right hand corner .

You can't. You are trying to solve a server issue with client side code and, as you see, you can't depend on it. Use sessions and timeouts on the sessions.

We have tried it, it works.

Obviously it doesn't "work" all the time.

but sometimes client tell us there is a error "access is denied" showed when click the X button.

Thats because you are using the wrong mechanism to solve your problem.

Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
.



Relevant Pages

  • Cookies Vs Sessions...?
    ... Can sessions work in the same way as my cookies? ... can seesions be set up to work accross browser sessions? ... The information contained in this e-mail message is intended only for ... If the reader of this message is not the intended recipient or an agent ...
    (php.general)
  • Re: Unique browser ID
    ... running on windows create just one session per machine regardless of the ... taking place between a client and that server. ... client) connects to a server that utilizes sessions, ... Since a browser can have many windows/tabs open and each window/tab can be ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Unique browser ID
    ... number of browser windows you have open - exactly the opposite to what you ... place between a client and that server. ... connects to a server that utilizes sessions, the server looks at the HTTP ... Since a browser can have many windows/tabs open and each window/tab can be ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Tabbed browsing in IE6 really sucks
    ... > I just had an IE6 browser crash because I switched to a new tab. ... > browser just disappeared but Ctrl-Alt-Del showed that the 4 sessions ... > browser and start several sessions in several tabs. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: ampersands in urls W3C validation problem
    ... >My website uses sessions and therefore sends PHPSessionID's throug the url ... >whenever a browser does not accept cookies. ...
    (alt.php)