Tune cookie behaviors for 'phcid', 'phreg', etc
Summary: Fixes T3471. Specific issues: - Add the ability to set a temporary cookie (expires when the browser closes). - We overwrote 'phcid' on every page load. This creates some issues with browser extensions. Instead, only write it if isn't set. To counterbalance this, make it temporary. - Make the 'next_uri' cookie temporary. - Make the 'phreg' cookie temporary. - Fix an issue where deleted cookies would persist after 302 (?) in some cases (this is/was 100% for me locally). Test Plan: - Closed my browser, reopned it, verified temporary cookies were gone. - Logged in, authed, linked, logged out. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T3471 Differential Revision: https://secure.phabricator.com/D8537
This commit is contained in:
@@ -30,6 +30,7 @@ final class PhabricatorAuthStartController
|
||||
// it and warn the user they may need to nuke their cookies.
|
||||
|
||||
$session_token = $request->getCookie(PhabricatorCookies::COOKIE_SESSION);
|
||||
|
||||
if (strlen($session_token)) {
|
||||
$kind = PhabricatorAuthSessionEngine::getSessionKindFromToken(
|
||||
$session_token);
|
||||
@@ -87,10 +88,7 @@ final class PhabricatorAuthStartController
|
||||
|
||||
if (!$request->isFormPost()) {
|
||||
PhabricatorCookies::setNextURICookie($request, $next_uri);
|
||||
|
||||
$request->setCookie(
|
||||
PhabricatorCookies::COOKIE_CLIENTID,
|
||||
Filesystem::readRandomCharacters(16));
|
||||
PhabricatorCookies::setClientIDCookie($request);
|
||||
}
|
||||
|
||||
$not_buttons = array();
|
||||
|
||||
Reference in New Issue
Block a user