php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51745 session_regenerate_id(TRUE); doesn't delete $_SESSION
Submitted: 2010-05-05 12:19 UTC Modified: 2010-05-05 16:20 UTC
From: maxtjh at hotmail dot com Assigned:
Status: Not a bug Package: Session related
PHP Version: 5.3SVN-2010-05-05 (SVN) OS: Window 7 Ultimate 32 bit
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: maxtjh at hotmail dot com
New email:
PHP Version: OS:

 

 [2010-05-05 12:19 UTC] maxtjh at hotmail dot com
Description:
------------
$_SESSION should become an empty array after session_regenerate_id with true, but it doens't!

Test script:
---------------
<?php
if(!isset($_SESSION)) session_start();

$_SESSION['a']='asd';

session_regenerate_id(TRUE);

echo var_dump($_SESSION).'<br/>';
?>


Expected result:
----------------
array(0) { } 

Actual result:
--------------
array(1) { ["a"]=>  string(3) "asd" } 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-05 16:20 UTC] derick@php.net
-Status: Open +Status: Bogus
 [2010-05-05 16:20 UTC] derick@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

It says nowhere that it empties the session. Actually, the documentation says explicitly that it does not.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Dec 19 05:00:01 2025 UTC