+3  A: 

the header-Function should be used like this:

header('Location: ../admin.php');

And even better would be if you specified the full absolute URL like this:

header('Location: http://www.example.com/admin.php');

That's because the RFC 2616 requires it to be an absolute URI (although most browsers support relative URL's too):

Location = "Location" ":" absoluteURI
Tomas Markauskas
A: 

Your location header should be:

header('Location: http://www.example.com/admin.php');

and you need to start the session at the top of the script using:

session_start();

That session start code should be at the start of every page that needs access to the $_SESSION variables.

Rich Bradshaw