Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Aug 28, 2020
1 parent 95d20f0 commit ebf081d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Concerns/InteractsWithCookies.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ public function cookie($name, $value = null, $expiry = null, array $options = []
}

if ($cookie) {
$decryptedValueCookieValue = decrypt(rawurldecode($cookie['value']), $unserialize = false);
$hasValuePrefix = strpos($decryptedValueCookieValue, CookieValuePrefix::create($name, Crypt::getKey())) === 0;
$decryptedValue = decrypt(rawurldecode($cookie['value']), $unserialize = false);

return ($hasValuePrefix) ? CookieValuePrefix::remove($decryptedValueCookieValue) : $decryptedValueCookieValue;
$hasValuePrefix = strpos($decryptedValue, CookieValuePrefix::create($name, Crypt::getKey())) === 0;

return $hasValuePrefix ? CookieValuePrefix::remove($decryptedValue) : $decryptedValue;
}
}

Expand Down

0 comments on commit ebf081d

Please sign in to comment.