sessions

From: Date: Thu, 06 Mar 2003 08:08:08 +0000
Subject: sessions
Groups: php.general 
Request: Send a blank email to php-general+get-138431@lists.php.net to get a copy of this message
Hi, Im working on a site where the user logs in , if username and password matches with uname and pword in database then he is a valid user. I then start a session with session_onstart() and have a variable for his username and for his permissions ! (these variables are stored on server) Once he entered the secrure area , there is a logoff button for the user to log off ! the logoff code looks like (<?php session_start(); $name = session_name(); session_unset(); session_destroy(); setcookie($name,"",-3600); print("<script language='javascript'>self.close();</script>"); ?> ) the above code deletes the cookie on the clients computer + the session variables on the server ! finally , here is my question ! If the user does not logoff , but simply closes the browser , the cookie on his computer will be deleted , but the session variables on the server will still be there ! How do i delete this ? Thanks a bunch ! Shaun -- Novtel Consulting Tel: +27 21 9822373 Fax: +27 21 9815846 Please visit our website: www.novtel.co.za

« previous php.general (#138431) next »