|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-07-05 09:02 UTC] tony2001@php.net
[2006-07-13 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 18:00:02 2025 UTC |
Description: ------------ Session randomizes, doesnt pickup Session id's from query string or cookie, when using $_SERVER or $_ENV before starting session. Reproduce code: --------------- <?php /* uncomment any line below to reproduce */ //$test = $_SERVER['REQUEST_URI']; //$test = $_SERVER['REMOTE_ADDR']; //$test = $_SERVER['']; session_start(); if (!isset($_SESSION['count'])) { $_SESSION['count'] = 0; } else { $_SESSION['count']++; } echo $_SESSION['count']; echo " <a href=\"test.php\">Refresh</a>"; echo '<pre>'; print_r(apache_response_headers()); ?> Expected result: ---------------- Well as there is no output, I assume it to use the session from the query_string, or cookie on the occasions it actually gets set. Actual result: -------------- When uncommenting any of the 3 commented lines above: - it constantly refreshes the session - 80% of the times applies urlrewrite which indecates cookies not working while it should. It works on $_ENV i believe too and possibly some other (global) arrays. Problem is I included classes before starting the session that are saved within the session. Without uncommenting the code runs perfect. Assigning strings & integers worked fine (havent tested any others), but using such a variable it resets.