Auth_HTTP setIdle() and setExpire()
| From: | rogue | Date: | Mon, 12 Apr 2004 19:54:10 +0000 |
| Subject: | Auth_HTTP setIdle() and setExpire() | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-11798@lists.php.net to get a copy of this message | ||
I see that Auth_HTTP inherits setIdle() and setExpire() from Auth::DB but I can't seem to get the Authentication to expire for me.
Here is a sample of what I am trying. Any thoughts? Does anyone know of any other examples of Auth_HTTP that I can look at besides what is in the pear docs?
Thanks
require_once("Auth/HTTP.php");
$AuthOptions = array(
'dsn'=>"mysql://user:pass@localhost/auth",
'table'=>"tbl_auth",
'usernamecol'=>"username",
'passwordcol'=>"password",
'cryptType'=>"md5",
'dbFields'=>"*"
);
$a = new Auth_HTTP("DB", $AuthOptions);
$a->setRealm('yourrealm');
$a->setIdle(30, true);
$a->setExpire(30);
$a->start();
$a->setCancelText('<h2>Error 401</h2>');
if($a->getAuth())
{
echo "Hello $a->username welcome to my secret page <BR>";
echo "Your details on file are: <BR>";
echo $a->getAuthData('userid'); // retriving other details from the database row
echo $a->getAuthData('telephone'); // in this example the user id, telephone number
echo $a->getAuthData('email'); // and email address
};