Hi,
Thanks for you help. It still does not work on my system.
I looked into Cookies in the browser (I use Firefox). Under localhost, it shows localhost PHPSESSID. Session variable of $_SESSION["value"] isn't there. I thought all session variables are stored as cookies along with the session id until the session is destroied.
By the way, session variable is essentially an array. I believe the syntax of $_SESSION[0] is perfectly legitimate.
Thanks
You mentioned that session variables are stored as "cookies along with the session id", however, that is not true in your case. The method that you are using I believe would not store the variables in the cookie, rather it would store it in a session file on the server side. The cookie is just to tell the server, which session it should be looking for.
Here is an example.
[PHP]
<?php
session_start();
$_SESSION['one'] = 1;
$_SESSION['two'] = 2;
echo session_id();
?>
[/PHP]
now if I were to go to my C:/wamp/www/tmp/ [whatever my session id was] file
and open it in a text editor.
one|i:1;two|i:2;
The above is stored in that file. There is documentation on session on www.php.net .
Anyhow, I tried your code, and I also tried putting in numbers like $_SESSION[3] , $_SESSION[4] and so on. They all give the same effect. I'm not an expert, but I think the above post might be right about using numbers are your keys in a superglobal.