php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21882 SID empty
Submitted: 2003-01-26 01:32 UTC Modified: 2003-01-27 02:02 UTC
From: sk at pilonet dot de Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.3.0 OS: Windows 2000 Server
Private report: No CVE-ID: None
 [2003-01-26 01:32 UTC] sk at pilonet dot de
Hi PHP-Team,

first of all, thanks for your hard work in developing and enhancing PHP.

I've got an installation of PHP 4.2.1 and 4.2.2, when I found out that the constant SID, which I wanted to append to JS-Popups, is of type String => "". So I recently updated to 4.3.0, same behavior as before. Additionally, no warning will be given, that SID is empty for any reason, if there is any? Sample script is this one:
<?php
session_start();
error_reporting(E_ALL);
var_dump(SID);
?>
Output is: string(0) ""

Same is, when you call get_defined_constants. SID is listed there, but an empty String also.

Thanks for any hint!

P.S: It is not easy for me to test with the latest CVS release because this server is a live one.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-26 06:41 UTC] magnus@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

 
Hint: session.use_trans_sid 
 [2003-01-26 21:52 UTC] sk at pilonet dot de
Sorry for reopening, but why shouldn't that be a bug in PHP? But, following your hint I tried the following with both session.use_trans_sid on and off:
<?php
session_start();
echo "Ini-Setting:" .ini_get("session.use_trans_sid")."<br />";
var_dump(SID);
?>

The result was the same. (No, I did not forget to restart apache). One time I got:
Ini-Setting:0
string(0) "" 

another time:
Ini-Setting:1
string(0) ""

So, please be more specific if I'm am wrong, but then it'll be a documentation problem, because SID is mentioned as a predefined constant there, without any limitations as e.x. ini-settings for trans_sid.

Thanks a lot,
Stefan
 [2003-01-27 02:02 UTC] sniper@php.net
RTFM:

"Alternatively, you can use the constant SID which is always defined. If the client did not send an appropriate session cookie, it has the form session_name=session_id. Otherwise, it expands to an empty string. Thus, you can embed it unconditionally into URLs."

http://www.php.net/manual/en/ref.session.php



 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Aug 13 22:00:03 2025 UTC