#21092 [Bgs->Csd]: No $_SESSION[] data saved
| From: | jeanfrederic at loiseau dot org | Date: | Thu, 19 Dec 2002 10:52:08 +0000 |
| Subject: | #21092 [Bgs->Csd]: No $_SESSION[] data saved | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-28018@lists.php.net to get a copy of this message | ||
ID: 21092
User updated by: jeanfrederic@loiseau.org
Reported By: jeanfrederic@loiseau.org
-Status: Bogus
+Status: Closed
Bug Type: Session related
Operating System: Windows XP
PHP Version: 4.2.3
New Comment:
I found the issue... it was (it seems) a mixed between Php 4.2.3 and
4.3RC0 that made a mess... I'have completely delete Php directory and
re-install 4.2.3, and now it is working fine...
Sorry for the trouble if I cause any...
Jean-Frederic
Previous Comments:
------------------------------------------------------------------------
[2002-12-19 03:53:14] JeanFrederic@Loiseau.org
Sorry, you're right... but in fact in my script example I missed a
part, the correct used script is
if (!isset($_SESSION['toto'])) $_SESSION['toto']=0;
Sorry for confusion... (why I didn't used copy&paste ? :-))
Jean-Frederic
------------------------------------------------------------------------
[2002-12-19 03:47:44] derick@php.net
Of course...
if $_SESSION['toto'] is 0 then
if (!$_SESSION['toto']) $_SESSION['toto'] = 0
will evaluate to:
if (!0) $_SESSION['toto'] = 0;
which is:
if (TRUE) $_SESSION['toto'] = 0;
so it will always reset the session variable to 0.
Not a bug -> bogus
------------------------------------------------------------------------
[2002-12-19 03:41:55] jeanfrederic@loiseau.org
I have added
echo "click <a href=\"test.php?".SID."\">here</a>";
in order to try to pass info in URL in case of cookie issue, and SID
return... nothing... but !
echo "sessionid = ".session_id()."<br>";
echo "sessionid = ".session_name()."<br>";
return correct session id and correct session name !
So in order to replace the not working SID, I put
echo "click <a
href=\"test.php?".session_name()."=".session_id()."\">here</a>";
Now the URL is showing the correct information, but still not working
for $_SESSION['toto'].
Jean-Frederic
------------------------------------------------------------------------
[2002-12-19 03:26:50] jeanfrederic@loiseau.org
I'm just wondering, why this code is not working
<?php
echo session_start();
if (!$_SESSION['toto']) $_SESSION['toto']=0;
else $_SESSION['toto']++;
echo "Toto = ".$_SESSION['toto'];
?>
under Windows XP + Php 4.2.3 + Apache 1.3.24
session_start() return TRUE, and the session file is created with the
correct content, but this content stay at value 0 for 'toto' between
pages.
I have tried the same thing under linux... same issue...
Php Config :
------------
Session Support enabled
session.auto_start Off
session.cache_expire 180
session.cache_limiter nocache
session.cookie_domain no value
session.cookie_lifetime 0
session.cookie_path /
session.cookie_secure Off
session.entropy_file no value
session.entropy_length 0
session.gc_maxlifetime 1440
session.gc_probability 1
session.name PHPSESSID
session.referer_check no value
session.save_handler files
session.save_path C:\winxp\temp
session.serialize_handler php
session.use_cookies On
session.use_trans_sid 0
Regards,
Jean-Frederic
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21092&edit=1