|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41916 $_SESSION array lost from one page to the next
Submitted: 2007-07-06 13:40 UTC Modified: 2007-07-06 14:56 UTC
From: richard at dominion-web dot com Assigned:
Status: Closed Package: Session related
PHP Version: 6CVS-2007-07-06 (snap) OS: Windows Server 2003
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: richard at dominion-web dot com
New email:
PHP Version: OS:


 [2007-07-06 13:40 UTC] richard at dominion-web dot com
I have a script that runs fine on all versions of PHP until I test with the latest 6.0.0 snapshot.  I am using URL sessions rather than cookie based sessions

On the first page I start the session with session_start(); and set some variables with $_SESSION['varname'] = 'value';

I check the session temp directory and the session is there


The page directs to the next page and can confirm that the session id in the URL is the same as that in the session temp directory.

However on both a print_r($_SESSION); and a var_dump($_SESSION); I get Array ( )  being outputted to the screen.

The data is still in the session temp file i.e. it hasn't been deleted, just the next script seems unable to read the data out of the file from one page to the next.

As I say this script works on PHP 4, 5, 5.1 and 5.2 just not on 6.0snapshot.

Reproduce code:
1st page

ini_set ( "session.use_cookies", 0);
$_SESSION['folder'] = 'INBOX';

2nd page

ini_set ( "session.use_cookies", 0);

Expected result:
To get a variable dump of the $_SESSION array with folder -> INBOX in it

Actual result:
Array(0) { }


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-06 13:42 UTC] richard at dominion-web dot com
Sorry wrong category
 [2007-07-06 13:58 UTC]
Works perfectly fine here as long as session.use_only_cookies = 0 and session.use_trans_sid = 1.

 [2007-07-06 14:56 UTC] richard at dominion-web dot com
Thanks, I wasn't setting session.use_only_cookies but only session.use_cookies
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 01:01:28 2024 UTC