Re: Session file problem?
| From: | Daniel Kullik | Date: | Thu, 01 Jul 2004 12:35:00 +0000 |
| Subject: | Re: Session file problem? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-189449@lists.php.net to get a copy of this message | ||
Info@Best-It wrote:
Code I¹m using: session_cache_expire(0); session_cache_limiter('private'); setcookie("cookie","",0,"/","iffinet.com",1); session_start(); I use session_destroy(); in the logout function but the /tmp/sess_* file does not get deleted. Also the cookie doesn¹t go away even though it is set to expire at the end of the session. How can I get the /tmp/sess_* file to go away along with the cookie? This is a description of the problems I am having: 2 Problems: 1. User A's information will come up when user B logs in instead of user B's information coming up when user B logs in... User A's information seems to be cached in /tmp/sess_8ce0348cbf6704f96c2d8094e876ac3b. Any ideas how to keep this from happening? 2. When a user exits Internet Explorer without logging off and invoking session_destroy(); the user cannot log back in immediately. If I SSH into the server and delete /tmp/sess_8ce0348cbf6704f96c2d8094e876ac3b then the user can log back in. Do I need to write a shell_exec routine to delete this file when the session is destroyed? How can I tell from the server that the user has closed the window? Thanks again! /TYou ought to check whether session_destroy() succeeds in removing the respective sess_* file. session_destroy() returns a boolean value. Be aware that session_destroy() won't remove any existing cookies. Also you should take a look at this notice (http://www.php.net/manual/en/function.session-cache-limiter.php): [snip] In private mode, the Expire header sent to the client may cause confusion for some browsers, including Mozilla. You can avoid this problem by using private_no_expire mode. The expire header is never sent to the client in this mode. [/snip] Daniel -- WWE e-commerce IT GmbH Eiffestrasse 462, D-20537 Hamburg Tel.: +49-40-2530659-0, Fax: +49-40-2530659-50