Greetings -
Perhaps someone can point out what I'm doing wrong with this code snippet. It's a basic user auth. script that's split up within multiple files.
this is in a function file
function require_user()
{
if(session_is_registered("valid_user"))
return true;
else {
$path=getenv("HTTP_REFERER");
session_register("path");
Header("location: login.php");
}
}
for each restricted page, the require user fcn is called
require_user();
However, when the user is transferred to the login page, the path is not being set. For some reason, the session value is not being stored. The call to session_start() is on every page. What am I missing?
Your advice will be greatly appreciated.
Thanks,
Andrew