Skip to content

Commit

Permalink
Fix a bug where session wasn't being restored from cookie if you clos…
Browse files Browse the repository at this point in the history
…ed your browser and went back to the CP.
  • Loading branch information
angrybrad committed Oct 9, 2013
1 parent 94834e8 commit 2de0237
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/services/UserSessionService.php
Expand Up @@ -612,7 +612,8 @@ protected function restoreFromCookie()
$userId = $sessionRow['userId'];

// Make sure the given session token matches what we have in the db.
if (craft()->security->checkPassword($currentSessionToken, $dbHashedToken))
$checkHashedToken= craft()->security->hashData(base64_encode(serialize($currentSessionToken)));
if (strcmp($checkHashedToken, $dbHashedToken) === 0)
{
// It's all good.
if($this->beforeLogin($loginName, $states, true))
Expand Down

0 comments on commit 2de0237

Please sign in to comment.