|  | Posted by jj on 06/18/59 11:34 
i tried with it and without it , it still doesnt work.
 "vdP" <hvdploeg_NO_SPAM@wanadoo.nl> wrote in message
 news:439f25ee$0$281$dbd4b001@news.wanadoo.nl...
 > jj wrote:
 > > Hi,
 > >
 > > I have a script that starts a session and registers a session variable
 as
 > > follows:
 > >
 > > ====================
 > > [login.php]
 > > ====================
 > > session_start();
 > > $_SESSION["userclass"]="admins";
 > > require('includes/application_top.php');
 > >  ======================
 > >
 > > in the second file i simply check if the variable has been set or not:
 > >
 > > ======================
 > > [application_top.php]
 > > ====================
 > > if(!isset($_SESSION["userclass"]))
 > > {
 > >     header("Location:login.php");
 > >     exit;
 > >  }
 > > ======================
 > >
 > >
 > > The problem is that no matter what my isset check always FAILS.
 Therefore
 > > always redirecting to the login.php page...Why is this? I checked the
 value
 > > of the "userclass" session variable and it has a value in it , but when
 i do
 > > my isset check (or any other check for that value) it always returns
 false
 > > therefore rendering the if statement which is not what i want.
 > >
 > > The other thing is if i take the snippet of code from the
 application_top
 > > file and put it together in just one file (in the login.php) it works
 > > perfectly fine.  so the fact that i split the code into 2 seprete files
 > > seems to make the problem.. any advise appricated!
 > >
 >
 > Do you use session_start() in the second script ?
 >
 > vdP
  Navigation: [Reply to this message] |