PHP - Sessions - Works & Doesnt Other Days

Try setting adminID to something more basic, eg:

$_SESSION[‘AdminID’]=“1234”;

Also, try commenting out the header calls in the login script, and echo some info, so you can see what is going on, i.e. $count and $adminid.

echo $_SESSION['AdminID'];

on the login page outputs the value 1 which is correct. So why when i go to admin.php is the session gone?

Well this is weird, I’d like to say a big thanks to Dave Alongi for fixing my issue. The problem was on the location it needed to have www. in it.

Not sure why but its done the trick :slight_smile:

Thanks for the help guys again!

Because the domain of the session didnt match. Yet another reason I dont use header(Location) ! :stuck_out_tongue_winking_eye:

I think the names of variables change. Hopefully this problem is solved.