|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-01-17 11:03 UTC] Basc at Basc dot de
When I compress my output with ob_gzhandler or with
zlib.output_compression trans sid doesn't work.
Without output compression trans sid works fine.
I use PHP 4.1.1 (Debian Package)
In following code php doesn't add the sid to the testlink
(sessioncookies are off)
<?php
session_start();
session_register("dummy");
$dummy=1;
if (!$sid) {
header("Location: $PHP_SELF?".SID);
exit();
}
?>
<a href="test.php">Testlink</a>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 09:00:01 2025 UTC |
I've tried a number of different combinations of both php.ini settings (zlib.output_compression and session.auto_start) as well as in-line function calls (session_start, ob_start("ob_gzhandler")), and in every situation I've found, the transient SID is lost when compression is turned on. Note that I'm using PHP 4.1.1 (4.1.2 is compiling as I type this) on RedHat Linux 7.2, and did compile it with --enable-trans-sid. Here's a summary of the 5 different tests I tried: [Test 1] php.ini: zlib.output_compression = Off session.auto_start = 0 --snip-- <? session_start(); session_register("testvar"); $testvar = "test value"; ?> <a href="/test.php">Testing</a> --snip-- Result: PHPSESSID gets appended correctly. [Test 2] php.ini: zlib.output_compression = Off session.auto_start = 1 --snip-- <? session_register("testvar"); $testvar = "test value"; ?> <a href="/test.php">Testing</a> --snip-- Result: PHPSESSID gets appended correctly. [Test 3] php.ini: zlib.output_compression = Off session.auto_start = 0 --snip-- <? ob_start("ob_gzhandler"); session_start(); session_register("testvar"); $testvar = "test value"; ?> <a href="/test.php">Testing</a> --snip-- Result: PHPSESSID is lost and not appended. [Test 4] php.ini: zlib.output_compression = On session.auto_start = 0 --snip-- <? session_start(); session_register("testvar"); $testvar = "test value"; ?> <a href="/test.php">Testing</a> --snip-- Result: PHPSESSID is lost and not appended. [Test 5] php.ini: zlib.output_compression = On session.auto_start = 1 --snip-- <? session_register("testvar"); $testvar = "test value"; ?> <a href="/test.php">Testing</a> --snip-- Result: PHPSESSID is lost and not appended.Works like a charm! Just tried 4.1.2 using ob_start("ob_gzhandler") and session_start(), and the SID was passed perfectly. I'll fiddle with the php.ini settings too and see how we do, but that's definitely good enough for me. Kudos!