Modified:
trunk/Lux/Auth/Adapter/Psql.php
Log:
There are *two* timeouts to set: one is for the cookie and the other is
to renew the token. So the 'cookie_expire' config key was added back.
The cookie timeout can be really long because the cookie will be
renewed automagically when the token timeout expires.
Modified: trunk/Lux/Auth/Adapter/Psql.php
==============================================================================
--- trunk/Lux/Auth/Adapter/Psql.php (original)
+++ trunk/Lux/Auth/Adapter/Psql.php Sun Mar 2 17:42:32 2008
@@ -48,6 +48,10 @@
* `cookie_name`
* : (string) Name of the cookie.
*
+ * `cookie_expire`
+ * : (int) Expiration time for the cookie, in seconds. Default is 2592000
+ * (one week).
+ *
* `cookie_path`
* : (string) Path option for setcookie().
*
@@ -259,7 +263,7 @@
// generate secret token
$token = md5(uniqid(rand(), true));
- // set timeout timestamp (in seconds)
+ // set timeout timestamp for the token (in seconds)
$timeout = time() + $this->_config['timeout'];
// update table info
@@ -278,7 +282,7 @@
setcookie(
$this->_config['cookie_name'],
"$identifier:$token",
- $timeout,
+ time() + $this->_config['cookie_expire'],
$this->_config['cookie_path'],
$this->_config['cookie_domain'],
$this->_config['cookie_secure'],