php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36041 session.use_trans_sid does not work
Submitted: 2006-01-17 03:24 UTC Modified: 2006-01-17 19:57 UTC
From: miguelangeldavila at argotvisual dot net Assigned:
Status: Not a bug Package: Session related
PHP Version: 5.1.2 OS: Linux
Private report: No CVE-ID: None
 [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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-17 07:52 UTC] sniper@php.net
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 19:36 UTC] miguelangeldavila at argotvisual dot net
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.
 [2006-01-17 19:57 UTC] tony2001@php.net
Constants are not carried through requests.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Dec 10 19:00:01 2025 UTC