#32064 [Opn->Bgs]: session_regenerate_id doesn't remove old session file
| From: | tony2001@php.net | Date: | Tue, 22 Feb 2005 10:26:34 +0000 |
| Subject: | #32064 [Opn->Bgs]: session_regenerate_id doesn't remove old session file | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-74414@lists.php.net to get a copy of this message | ||
ID: 32064
Updated by: tony2001@php.net
Reported By: michal-bcc at logix dot cz
-Status: Open
+Status: Bogus
Bug Type: Session related
Operating System: Linux/x86
PHP Version: 4.3.8
New Comment:
>IMO it should be removed at the time of session_regenerate_id()
completion.
Why do you think so?
_All_ session files are removed by garbage collection, if you want to
kill your session file explicitly - you have to call
session_destroy().
That's expected behaviour and I don't see any bugs here.
Previous Comments:
------------------------------------------------------------------------
[2005-02-22 11:13:20] michal-bcc at logix dot cz
Description:
------------
When regenerating session ID with session_regenerate_id() the file with
old ID is kept in the appropriate directory.
Say that I create a session with session_start() and get ID=abcd. Then
sess_abcd is created.
Later I decide to generate a different ID for whatever reason, call
session_regenerate_id() and get ID=1234. The old file sess_abcd,
although truncated, is still kept in the filesystem. IMO it should be
removed at the time of session_regenerate_id() completion.
Reproduce code:
---------------
<?
session_start();
echo "session1 = ".session_id();
session_regenerate_id();
echo "session2 = ".session_id();
?>
Expected result:
----------------
Only a single file sess_<session2> should be in session dir.
Actual result:
--------------
However both files are still there...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32064&edit=1