Jump to content


Photo

Killing a session


  • Please log in to reply
3 replies to this topic

#1 Biax

Biax
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 07 October 2006 - 02:57 AM

Hello everyone, this is probably a totally lame question, but I've been developing my website that has a whole bunch of session variables for things like user log in and navigation.

But if I browse away from the website and come back to it, it's still remembering values, and I don't want that! So how can I set it up so it destroys the session, ie, how do I know when the user has browsed off the website?

#2 oracle259

oracle259
  • Members
  • PipPipPip
  • Advanced Member
  • 119 posts

Posted 07 October 2006 - 04:34 AM

You can try capturing the referrer address of the user and if the url doesnt start with ur default url then destroy session cookie and ask for user login

for eg.

http://www.yahoo.com not https://www3.oracle.banzu.com

#3 tleisher

tleisher
  • Members
  • PipPipPip
  • Advanced Member
  • 88 posts

Posted 07 October 2006 - 05:52 AM

Best bet is just to set a certain time limit and unset() the session after that time is up...a session stays active until the browser is closed.

#4 oracle259

oracle259
  • Members
  • PipPipPip
  • Advanced Member
  • 119 posts

Posted 07 October 2006 - 06:55 PM

I guess it all depends on what you want to accomplish. If you want to setup a session timeout arrangement where the user is logged out based on a set time of inactivity then tleisher is correct and a timeout script is best. However, the timeout script will not work if the user leaves the site and returns in time so as not to timeout.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users