User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 427,765 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,704 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 2773 | Replies: 1
Reply
Join Date: Jun 2005
Posts: 50
Reputation: Naters_uk is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
Naters_uk Naters_uk is offline Offline
Junior Poster in Training

Question How to end a session immediately when the browser closes?

  #1  
Feb 8th, 2006
Sessions DO NOT end when a user closes their browser. There is no communication with the server when a browser is closed so there is no way the server can know to end the session. The same is true when you leave the site for another. Again no communication takes place between your browser and the site you're leaving so the server never knows you've left.

Basically the only solution I know of is to set up a client-side event to call a server-side script to abandon the session when the user leaves.

Anyone knows how to write a javascript to end a session when the browser is being closed?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Posts: 1,590
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 35
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: How to end a session immediately when the browser closes?

  #2  
Feb 8th, 2006
Sessions are controlled by the web server... you can't terminate them with JavaScript code. Usually, sessions are set to time-out in 15 minutes (I think that's IIS' default, different web servers may vary).
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 1:09 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC