summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-07-05 10:40:41 -0400
committerFrederic Guillot <fred@kanboard.net>2015-07-05 10:40:41 -0400
commit45774afafcae850ecf71ea90b426fffc2c6f0628 (patch)
treeeda76d88e4d5493b4e43e3a6db8e44e23a5960da
parente7b967d7432267d48e54d7775d0baf1e411178e7 (diff)
Do not rewrite remember me cookie for each request
-rw-r--r--app/Auth/RememberMe.php34
-rw-r--r--app/Model/Authentication.php5
2 files changed, 5 insertions, 34 deletions
diff --git a/app/Auth/RememberMe.php b/app/Auth/RememberMe.php
index e8b20f37..eebf4f4b 100644
--- a/app/Auth/RememberMe.php
+++ b/app/Auth/RememberMe.php
@@ -119,31 +119,6 @@ class RememberMe extends Base
}
/**
- * Update the database and the cookie with a new sequence
- *
- * @access public
- */
- public function refresh()
- {
- $credentials = $this->readCookie();
-
- if ($credentials !== false) {
-
- $record = $this->find($credentials['token'], $credentials['sequence']);
-
- if ($record) {
-
- // Update the sequence
- $this->writeCookie(
- $record['token'],
- $this->update($record['token']),
- $record['expiration']
- );
- }
- }
- }
-
- /**
* Remove a session record
*
* @access public
@@ -197,9 +172,10 @@ class RememberMe extends Base
$this->cleanup($user_id);
- $this->db
- ->table(self::TABLE)
- ->insert(array(
+ $this
+ ->db
+ ->table(self::TABLE)
+ ->insert(array(
'user_id' => $user_id,
'ip' => $ip,
'user_agent' => $user_agent,
@@ -207,7 +183,7 @@ class RememberMe extends Base
'sequence' => $sequence,
'expiration' => $expiration,
'date_creation' => time(),
- ));
+ ));
return array(
'token' => $token,
diff --git a/app/Model/Authentication.php b/app/Model/Authentication.php
index 86c1c43f..31969b57 100644
--- a/app/Model/Authentication.php
+++ b/app/Model/Authentication.php
@@ -49,11 +49,6 @@ class Authentication extends Base
return false;
}
- // We update each time the RememberMe cookie tokens
- if ($this->backend('rememberMe')->hasCookie()) {
- $this->backend('rememberMe')->refresh();
- }
-
return true;
}