Posted by stathisgotsis on 04/14/06 11:01
I am building a site and i want to password protect some pages. In
order to do this i use this variable: $_SESSION['validated'] and i set
it to true when a user has logged in. So in one file when a user has
logged in i have the following:
<?php
@session_start();
$_SESSION['validated']=true;
?>
I am trying to check if this variable is set to true in some other file
like this:
<?php
@session_start();
if ( isset($_SESSION['validated']) && $_SESSION['validated']==true )
{
/*Something*/
}
else
{
/*Do something else*/
}
?>
The problem is it seems i cannot access the $_SESSION['validated'] in
other files than the one i set it. What is the solution to this
problem? Please help
Navigation:
[Reply to this message]
|