Hey. Im having a very strange session problem!
I have a login.php and default.php.
The login page's session script is:
if($Submit=="Login"){
session_start();
$statusCheck = check_login($HTTP_POST_VARS);
if ($statusCheck == "Admin" || $statusCheck == "Staff"){
session_register("statusCheck");
header("Location: default.php");
}
}
The default page's session script is:
session_start();
if($action=="logout"){
session_unregister("statusCheck");
session_destroy(); }
if (!session_is_registered("statusCheck"))
header("Location: login.php");
The session starts correctly when login.php and default.php are in the same foder. However, if I move them into different folders the session wont start!
login page's script with different header location:
if($Submit=="Login"){
session_start();
$statusCheck = check_login($HTTP_POST_VARS);
if ($statusCheck == "Admin" || $statusCheck == "Staff"){
session_register("statusCheck");
header("Location: ../_memsect/default.php");
}
}
default page's script with different header location:
session_start();
if($action=="logout"){
session_unregister("statusCheck");
session_destroy(); }
if (!session_is_registered("statusCheck"))
header("Location: ../nav_pages/login.php");
Why am I getting this problem? It doesnt make sence at all! help would be appreciated! Thx.