Posted by lorenzdominic_ on 08/17/06 23:22
Hi
I am new to sessions and php and have been playing around with them -
and would like to know why this is happening?
Firstly I have a login page and it goes to a verify page which creates
a session like so:
>From verify.php-
ini_set("session.save_handler", "files");
session_save_path ("mywebsite.com/tmp");
session_name();
session_start();
session_register("user");
I then redirect to the users page like this:
$url= "Location:mypage.php";
header($url);
exit();
Once in mypage.php
I use the following session functions - I have to keep using the fist
two lines in my php pages which use sessions as it was requested by my
ISP:
>From mypage.php-
ini_set("session.save_handler", "files");
session_save_path ("mywebsite.com/tmp");
session_start();
Now comes the strange part or is it?
I can access the "user" variable which was registered by the verify
page. I do this WITHOUT any references to the correct Session ID as
follows:
print $user;
How is this possible?
My question is how does PHP know which Session ID is the correct one if
I have hundreds of users and I am not giving PHP the correct Session ID
just calling a variable from within a Session object?
Please help this is really weird and seems buggy??????????
Regards
Dominic
Navigation:
[Reply to this message]
|