accessing session in PHP -


i have stored session using following in 1 of .php file:

session_start();     $_session['uid'] = $_post['uid'];  

when navigate other .php file , tried access value doing:

$_session['uid'] 

i got error:

notice: undefined variable: _session in c:\wamp\www\saved.php on line 6 

line 6 is:

$result->execute(array($_session['uid'])); 

why this?

you need make sure call session_start() on every page on want access session vars.


Comments