php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37962 Sessions not working when zlib.output_compression is set to on
Submitted: 2006-06-29 17:32 UTC Modified: 2006-07-05 16:34 UTC
From: oriol dot gual at gmail dot com Assigned:
Status: Not a bug Package: Session related
PHP Version: 5.1.4 OS: Windows XP SP2
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: oriol dot gual at gmail dot com
New email:
PHP Version: OS:

 

 [2006-06-29 17:32 UTC] oriol dot gual at gmail dot com
Description:
------------
When zlib.output_compression is set to On, PHP always starts a new session.  I've looked at the headers, and PHP is always sending the cookie for the session id. The same happens using trans sid on, or manually appending the session id to the link. If zlib.output_compression is turned Off it's working ok.

Also, if I use ob_start("ob_gzhandler"); first and then ob_end_flush(); at the end, everything works as expected.

Reproduce code:
---------------
<?php
session_start();
if (!isset($_SESSION['count'])) {
   $_SESSION['count'] = 0;
} else {
   $_SESSION['count']++;
}
echo $_SESSION['count'];
echo " <a href=\"test.php">Refresh</a>";
?>

Expected result:
----------------
0, 1, 2, 3 , 4...

Actual result:
--------------
0, 0, 0, 0, 0...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-29 18:04 UTC] mike@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip
 [2006-07-04 15:20 UTC] oriol dot gual at gmail dot com
Isn't working either. But I have noticed some things:

If cookies are enabled it never works, but when cookies are disabled and the SID is appended, it works randomly.

Hope it helps.
 [2006-07-05 16:34 UTC] oriol dot gual at gmail dot com
I'm not sure what it was, but I've reset the php.ini and now is working ok.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 16 22:01:31 2024 UTC