Re: sessions
| From: | Marek Kilimajer | Date: | Thu, 06 Mar 2003 10:08:18 +0000 |
| Subject: | Re: sessions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-138444@lists.php.net to get a copy of this message | ||
The session file will be deleted automatically by the garbage colector after certain amount of time, specified in php.ini by session.gc_maxlifetime
Shaun van den Berg wrote:
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