Possible Duplicate:
Difference between session_register and $_SESSION[]
this might sound weird but my problem is this:
If user enters valid login details i take the ip address and the id of the user and put into:
$_SESSION['ip']=$_SERVER['REMOTE_ADDR'];
and:
$_SESSION['id'];
and redirect to the welcome.php where i check if the session is already started :
if(!isset($_SESSION['id'])&&!isset($_SESSION['ip'])) {...redirect to error page..}
The problem is that if the user enter valid details he is not redirected to welcome.php.
I change $_SESSION[‘id’] to session_register(“id”); and everything work fine.
All this is on my local xampp server.I dont want to use session_register cuz it is deprecated in the newer versions of php, and its not recomended for using.
So please, how can i solve this ?
session_registerimplicitly callssession_start, which will make$_SESSIONwork. Explicitly callsession_startbefore you access$_SESSION.