I've got authlib up-and-running perfectly, with my own
fields and a couple of other additions; however, how
do I then check for the existence of the cookie on
other pages I want to have access restricted to?
To do this, I have found that you need to do the following.
1.) modify backend.php and change the call to setcookie in
the login function to include the path to be "/" if you
want the cookie to be available outside of the authlib
directory structure.
setcookie("authlib", "$username:$hash:$id", time()
+3600, "/")
2.) then to check the cookie, make sure that your page is a
php page, and include the following code:
Logged In: YES
user_id=392739
To do this, I have found that you need to do the following.
1.) modify backend.php and change the call to setcookie in
the login function to include the path to be "/" if you
want the cookie to be available outside of the authlib
directory structure.
setcookie("authlib", "$username:$hash:$id", time()
+3600, "/")
2.) then to check the cookie, make sure that your page is a
php page, and include the following code:
<?
require ("./authlib/backend.php");
$login_check = $authlib->is_logged();
if (!$login_check)
{
//User is not logged in.
}
else{
//User is logged in.
}
?>
I think that should do it for you.
Logged In: NO
sory bat this change in my script not work
why???