Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
January 8, 2006, 11:42 am
rate this thread
I have the following file:
echo 'your account has been loaded, <a
I run it like this: myfile.php?s=abc
It does not matter how many times I load it, whenever I load my test file:
The same old session ID comes back (definitely not abc or any other
parameter that I pass using s). Having said that, in the link to index.php,
it provides the new session ID, but as soon as I reload the page, we are
back to normal.
The ONLY way to delete this old session ID is to delete the cookie from my
What am I doing wrong. It is driving me nuts!
Re: i am going nuts = new session id just will not work
What are you trying to do?
The session id will stay the same as long as the browser is open (within
the garbage collection time)
The session id serves as a reference to session variables which are
stored on the server. Therefore it is vitally important that it does
stay the same.
As you've found out the session id is stored in a cookie. You only have
to pass it by URL if you expect cookies to be turned off. Since the
cookie is only a memory cookie, most of the time you will be ok. If in
doubt you have to pass the session id or have it automatically enabled
on the server. The session id is available as a constant SID
If you want to store 'abc' by doing myfile.php?s=abc
echo "your account has been loaded, <a
You will find that the session id will not show unless cookies are
index.php must have session_start() as the first line
$_SESSION['s'] will contain your variable 'abc'
Geoff Berrow 0110001001101100010000000110