php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #39748 session is reset when you open it from another browser
Submitted: 2006-12-05 20:39 UTC Modified: 2006-12-06 19:05 UTC
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:0 of 2 (0.0%)
From: str at strgt dot cjb dot net Assigned: theseer (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.2.0 OS: Debian GNU/Linux
Private report: No CVE-ID: None
 [2006-12-05 20:39 UTC] str at strgt dot cjb dot net
Description:
------------
I open a session in browserA and get session_id() = X;... I set some vars to $_SESSION and then go to browserB where I get session_id() = Y. If i try to set the session_id(X) in browserB, the session is destroyed and I cannot see the session from browserA or browserB.

You can test the code in 
http://develsystems.com/sessionTest.php
http://develsystems.com/sessionTest.phps

And see the phpinfo in

http://develsystems.com/phpinfo.php

Reproduce code:
---------------
<?php
  if ($_GET['SES']) {
          session_id($_GET['SES']);
  }
  
  session_start();
  
  echo session_id();

  if (isset($_GET['a'])) {
      $_SESSION['a'] =  $_GET['a'];
  }
  
  
  echo '<pre>'; var_dump($_SESSION);

Expected result:
----------------
It should open the session from browserA in browserB and not destroy it.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-05 20:47 UTC] joey@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

As you were told in IRC, this is not a PHP bug.
 [2006-12-05 21:34 UTC] str at strgt dot cjb dot net
I checked in 2 servers with the same PHP version and got the same error
 [2006-12-06 11:13 UTC] theseer@php.net
This is expected behaviour and not a bug in php. Setting the session-id manually assumes that there is no such session, thus destroying any session data already existing under the given ID.

Reassigning this as a documentation issue.

 [2006-12-06 14:15 UTC] str at strgt dot cjb dot net
@theseer: is it really a documentation issue?

I test the same code in other PHP versions, and it worked fine. The session is not erased.
 [2006-12-06 19:05 UTC] str at strgt dot cjb dot net
I changed the PHP implementation (was using the PHP package from dotdeb, now I have PHP package from debian-testing) and now it works....  sorry
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC