php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60101 Limit to session_regenerate_id updates
Submitted: 2011-10-19 22:54 UTC Modified: 2013-02-18 00:35 UTC
From: funkychunkymunky at gmail dot com Assigned:
Status: No Feedback Package: Session related
PHP Version: 5.3.8 OS: Debian Squeeze
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-10-19 22:54 UTC] funkychunkymunky at gmail dot com
Description:
------------
Was doing some debugging on our session class and wanted to start from scratch on 
a few tests so we came up with the following, just to see how frequently we his 
collisions using the default session configs.

It appears that session_regenerate_id quits regenerating after 114 runs, after 
which the function simply fails.



Test script:
---------------
$arr = array();
session_id();
session_start();

for( $i = 0; $i <= 100000; $i++ )
{
        $ses = session_id();
if(!session_regenerate_id(true) ) {
exit;
}
        echo "Session: ". $ses. "\n";
        $arr[$ses]++;
}
print_r( array_count_values( $arr ) );

Expected result:
----------------
Every call to session_regenerate_id and then to session_id would result in a new 
ID, and without limit.




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-23 03:19 UTC] yohgaki@php.net
-Status: Open +Status: Feedback
 [2011-11-23 03:19 UTC] yohgaki@php.net
I've test with my PHP 5.3 and trunk (with strict session patch) with cli. 
Although, I had to add ob_start() at the beginning, it executes all.

I guess you are using Apache web server to test it. Is there any crash log in 
your apache's error_log? If so, please submit backtrace.
 [2013-02-18 00:35 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Dec 09 20:05:53 2022 UTC