php.net |  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: richard at dominion-web dot com
New email:
PHP Version: OS:

 

 [2007-07-06 13:40 UTC] richard at dominion-web dot com
Description:
------------
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

---
folder|S:5:"INBOX";
---

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_start();
$_SESSION['folder'] = 'INBOX';

2nd page

ini_set ( "session.use_cookies", 0);
session_start();
var_dump($_SESSION);

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

Actual result:
--------------
Array(0) { }

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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] tony2001@php.net
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-2023 The PHP Group
All rights reserved.
Last updated: Fri Feb 03 08:05:55 2023 UTC