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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JavaScript: Retrieving a Location

Status
Not open for further replies.

flanakin

Programmer
Mar 21, 2000
158
US
Yes, I know how to get the current location. But, I want to check the location a user is GOING to. Why? Well, if a user is leaving my site, I want to end the session so that the server is freed of that persons session varibles. At any givien time, there could be 1000 or more users on the site. This is an increase that has not happened yet, but is projected to happen within the next couple of weeks. In order to keep the server up and running, I wanted to reduce the strain. So, I want to force the session to end when I leave the page.

So, my question to you is...how? Currently, I have a function running when the onUnload event occurs. But, is there a way to get the address that the user types into the address bar? If I don't check this, the window will end the session if a user clicks the refresh button.

Any and all suggestions are appreciated. Thanks.
 
You can't and doesn't need to do this on client side. It's a common problem and common solution is to store session in cookies or by IP (as you prefer - cookies is slightly better, but have some disadvantages). And session terminated by timeout (something about [one/half/two] hour is traditional). If user doesn't hits your page within an hour it's session expires.
--
Michael Dubner
Brainbench MVP/HTML+JavaScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top