|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-01-17 03:24 UTC] miguelangeldavila at argotvisual dot net
Description:
------------
PHP 5.1.2 does not print session_id automatically into pages code. The session.use_trans_sid stoped working after install PHP 5.1.2. Despite php.ini has session.use_trans_sid=1, and even the program has a line ini_set('session.use_trans_sid', 1);
Reproduce code:
---------------
php.ini
session.use_trans_sid=1
code
ini_set('session.use_trans_sid', 1);
Expected result:
----------------
<a href="page.php?PHPSESSION=XXXXXXXXXXX">
<form method="post" action="auditores_form_delete.php?PHPSESSION=XXXXXXXXXXX">
Actual result:
--------------
<a href="page.php>
<form method="post" action="auditores_form_delete.php>
PHP does not print session id automatically
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 10 19:00:01 2025 UTC |
PHP 5.1.2 does not assign the correct value to the constant SID. I did a test: #### Origin page #### --------------------------- <?php // Origin page: session_start(); $_SESSION['Perfil'] = hola; echo "<pre>"; print_r($_SESSION); echo "\nconstant SID: ".SID; echo "\nconstant(\"SID\") ". constant("SID"); if (defined('SID')) { echo "\nSID is defined"; } echo "\n"; echo "</pre>"; ?> <a href="pba1.php">Destination page</a> -------------------------------------- As espected SID echoes PHPSESSID=5c2a8e480f4c0b649850fb6da527a6ab And the constant seems to be declared. But in the destination page SID echoes none value (blank). The constant seems to be declared using: if (defined('SID')) { echo "\nSID is defined"; } #### Destination page code #### <?php // Destination page session_start(); echo "<pre>"; print_r($_SESSION); define("SID", session_name() ."=".session_id()); echo "\nconstant SID value: ".SID; echo "\nQuering by constant(\"SID\") ". constant("SID"); if (defined('SID')) { echo "\nSID is defined"; } echo "</pre>"; echo "\n"; ?> <a href="pba.php">Origin page</a> As consequence the session is not transfered via SID.