php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42899 problems with session_regenerate_id(true)
Submitted: 2007-10-09 09:58 UTC Modified: 2007-10-09 16:13 UTC
From: p dot nijs at xs4all dot nl Assigned:
Status: Not a bug Package: Session related
PHP Version: 5.2.4 OS: Debian Etch
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: p dot nijs at xs4all dot nl
New email:
PHP Version: OS:

 

 [2007-10-09 09:58 UTC] p dot nijs at xs4all dot nl
Description:
------------
Session_regenerate_id(true) leaves a bunch of new sessions behind when stress-testing by doing a continue page refresh (F5 in IE/Windows).




Reproduce code:
---------------
<?php
session_start();

$old_sessionid = session_id();

session_regenerate_id(true);

$new_sessionid = session_id();

echo "Old Session: $old_sessionid<br />";
echo "New Session: $new_sessionid<br />";

echo "Please look for the amount of newly created sessions in " . session_save_path();

?>

Navigate to this file with your browser and hold F5 continuously for 5 seconds, triggering multiple refreshes after each other.


Expected result:
----------------
Only 1 session should be in the session_save_path (the newly generated session only, the old ones should have been deleted).


Actual result:
--------------
Multiple sessions were created, it seems that the PHP-engine didn't have the time(?) to delete the old sessions.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-09 16:13 UTC] johannes@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Check the session.gc_* settings and docs
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 15 05:01:33 2025 UTC