hi people
i have been having this strange problem with my session handling script . i have the following code in my login script
(i have shown only relevant script)
1) //--login.php
session_start();
session_register("userid");
session_encode();
$url = "Location: main.php?PHPSESSID=".$PHPSESSID;
header($url);
2) //---and in the subsequent pages i check for session is registered or not with the following script
session_start();
if (!(session_is_registered("userid")))
{
session_unset();
session_destroy();
$url = "Location: login.php";
header($url);
}
else
{
//--- will open the page successfully
}
but the second piece of code doesnt seem to be recognising the session as registered even though the session is registered .
i dont kno what the problem. could somebody help me pls?