ID: 36041
User updated by: miguelangeldavila at argotvisual dot net
Reported By: miguelangeldavila at argotvisual dot net
-Status: Bogus
+Status: Open
Bug Type: Session related
Operating System: Linux
PHP Version: 5.1.2
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2006-01-17 07:52:10] [EMAIL PROTECTED]
It won't be printed if it's available through other means, in this case
in the cookie. This is expected behaviour.
(hint: Turn off cookies..)
------------------------------------------------------------------------
[2006-01-17 03:24:52] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36041&edit=1