RE: [PHP] session problem
| From: | Naintara Jain | Date: | Tue, 09 Jul 2002 02:16:05 +0000 |
| Subject: | RE: [PHP] session problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-106083@lists.php.net to get a copy of this message | ||
Just thought I'd mail it here.
It's a reported bug, Bug #16263.
Discovered (after hours of agonizing).
martin, values were being assigned and passed :) thanks anyway.
-----Original Message-----
From: Martin Clifford [mailto:MLC1@nrc.gov]
Sent: Monday, July 08, 2002 6:29 AM
To: naintara@del6.vsnl.net.in
Subject: Re: [PHP] session problem
You have to set the variables before using session_register().
<?php
session_start();
$var = "Yo";
session_register("var");
?>
If you try registering a variable that has no value, then of course no value
can be carried over to the next page. :o)
Martin
>>> "Naintara Jain" <naintara@del6.vsnl.net.in> 07/06/02 09:08PM
>>> >>>
I am storing some values in session variables.
The behavior of the session is pretty unpredictable.
On the first page I begin with:
session_name("aname")
session_start()
session_register("var1","var2")
In another page I check for existing value of session variable "var2".
In the next page I have the following code:
session_name("aname")
session_start()
if(($var2)=="" || !isset($var2))
"invalid"
But the strange thing is that the session value is not accessible in the
other page.
I have tried passing the session id though session_id() in the URL.
Session handling has been giving me some trouble (windows 2000, IIS)
The strange thing is that it works some times.
Can anyone give any pointers?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php