summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Cornutt <enygma@phpdeveloper.org>2015-07-03 06:45:21 -0500
committerChris Cornutt <enygma@phpdeveloper.org>2015-07-03 06:45:21 -0500
commit8e4a9cd6f2e43a3ad9f5e8066d8b81e9e83eeb5f (patch)
treeb646f096b834ba136e884460eb0e946cc44322c7
parentfc2dbe1fe6ae86742c7f46f21f526c49c142a6f6 (diff)
parent63cf4b2e5dc8aeda0a897d67f5818f333f507ece (diff)
downloadgatekeeper-8e4a9cd6f2e43a3ad9f5e8066d8b81e9e83eeb5f.zip
gatekeeper-8e4a9cd6f2e43a3ad9f5e8066d8b81e9e83eeb5f.tar.gz
gatekeeper-8e4a9cd6f2e43a3ad9f5e8066d8b81e9e83eeb5f.tar.bz2
Merge pull request #16 from jdudley1123/patch-12.5
Fix for cookie setting and verification issue
-rw-r--r--src/Psecio/Gatekeeper/Session/RememberMe.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Psecio/Gatekeeper/Session/RememberMe.php b/src/Psecio/Gatekeeper/Session/RememberMe.php
index 6829b68..1402ef0 100644
--- a/src/Psecio/Gatekeeper/Session/RememberMe.php
+++ b/src/Psecio/Gatekeeper/Session/RememberMe.php
@@ -132,7 +132,7 @@ class RememberMe
// Remove the token (a new one will be made later)
$this->datasource->delete($token);
- if (\Psecio\Gatekeeper::hash_equals($this->data[$this->tokenName], $token->id.':'.hash('sha256', $userToken)) === false) {
+ if (\Psecio\Gatekeeper\Gatekeeper::hash_equals($this->data[$this->tokenName], $token->id.':'.hash('sha256', $userToken)) === false) {
return false;
}
@@ -256,11 +256,11 @@ class RememberMe
public function setCookies(\Psecio\Gatekeeper\AuthTokenModel $tokenModel, $token, $https = false, $domain = null)
{
if ($domain === null && isset($_SERVER['HTTP_HOST'])) {
- $domain = $_SERVER['HTTP_HOST'];
+ $domain = ($_SERVER['HTTP_HOST'] != 'localhost') ? $_SERVER['HTTP_HOST'] : false;
}
$tokenValue = $tokenModel->id.':'.hash('sha256', $token);
$expires = new \DateTime($this->expireInterval);
return setcookie($this->tokenName, $tokenValue, $expires->format('U'), '/', $domain, $https, true);
}
-} \ No newline at end of file
+}