|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24315 ob_gzhandler fails with with sessions and trans_sid
Submitted: 2003-06-24 07:55 UTC Modified: 2003-07-24 10:05 UTC
From: usenet0 at malkusch dot de Assigned:
Status: Closed Package: Session related
PHP Version: 4.3.2 OS: Linux
Private report: No CVE-ID:
 [2003-06-24 07:55 UTC] usenet0 at malkusch dot de

When using the ob_gzhandler (and no output_buffering is set in .htaccess) and using Sessions it won't compress the output.

And this happens only when PHP needs to rewrite the output because of trans_sid.

In PHP 4.3.0 additionally the Error "Warning: (null)() [ref.outcontrol]: output handler 'ob_gzhandler' cannot be used twice in Unknown on line 0" occured.

Bye Markus Malkusch

Reproduce code:
if (!isset($_SESSION['i'])) {
	$_SESSION['i'] = 1;
} else {
echo 'i = '.$_SESSION['i'];
?><a href="bug.html">bug.html</a>

Expected result:
A compressed output to the browser even, when URIs are rewritten.

Actual result:
No compressed output, when PHP has to rewrite the URIs.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-24 10:05 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

PHP now (latest stable CVS) reports the correct error message (ob_start(): output handler 'ob_gzhandler' cannot be used after 'URL-Rewriter') if you call ob_start('ob_gzhandler'); after session_start hs been called and trans_sid is used.
The solution is to call ob_start('ob_gzhandler'); before session_start().
PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 22:01:33 2015 UTC