Auth::setExpire
| From: | Richard B. Pyne | Date: | Thu, 12 Jun 2003 18:03:18 +0000 |
| Subject: | Auth::setExpire | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-5920@lists.php.net to get a copy of this message | ||
I am a newby to both PHP and to the Auth package, so please
forgive me if I am doing something stupid.
I am trying to get expirations to work such that as long as a
user is actively working, their session will stay alive, but if
they go for a set time without doing anything their session will
time out.
I have successful set an initial expire time, but I cannot for
the life of me get it to reset or extend that time.
Here is the code I am currently using:
$dsn = "pgsql://$dbuser:$dbpass@$dbhost/$dbname";
$params = array(
"dsn" => $dsn,
"table" => "staff",
"usernamecol" => "id",
"passwordcol" => "password"
);
$myauth = new Auth("DB", $params, "loginFunction");
$myauth->setExpire(30, true);
$myauth->start();
if ($myauth->getAuth()) {
echo "<html>\n";
echo "<body>\n";
echo "You have been authenticated successfully";
echo "</body>\n";
echo "</html>\n";
}
I have tried using the setExpire both with and without the add
parameter and see no difference in how it works.
I also found that if the setExpire is after the start() it seems
to have no effect at all.
Thanks for any help.
--Richard
------------------------------
Richard B. Pyne, NZ7K
rpyne@kinfolk.org
http://pyne.kinfolk.org/rbp2