Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/constants/PhabricatorCookies.php
Context not available. | |||||
// temporary and clearing it when users log out. | // temporary and clearing it when users log out. | ||||
$value = $request->getCookie(self::COOKIE_CLIENTID); | $value = $request->getCookie(self::COOKIE_CLIENTID); | ||||
if (!strlen($value)) { | if (!@strlen($value)) { | ||||
$request->setTemporaryCookie( | $request->setTemporaryCookie( | ||||
self::COOKIE_CLIENTID, | self::COOKIE_CLIENTID, | ||||
Filesystem::readRandomCharacters(16)); | Filesystem::readRandomCharacters(16)); | ||||
Context not available. | |||||
// Old cookies look like: /uri | // Old cookies look like: /uri | ||||
// New cookies look like: timestamp,/uri | // New cookies look like: timestamp,/uri | ||||
if (!strlen($cookie)) { | if (!@strlen($cookie)) { | ||||
return null; | return null; | ||||
} | } | ||||
if (strpos($cookie, ',') !== false) { | if (@strpos($cookie, ',') !== false) { | ||||
list($timestamp, $uri) = explode(',', $cookie, 2); | list($timestamp, $uri) = @explode(',', $cookie, 2); | ||||
return array((int)$timestamp, $uri); | return array((int)$timestamp, $uri); | ||||
} | } | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0