Consolidate use of magical cookie name strings
Summary: Ref T4339. We have more magical cookie names than we should, move them all to a central location. Test Plan: Registered, logged in, linked account, logged out. See inlines. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T4339 Differential Revision: https://secure.phabricator.com/D8041
This commit is contained in:
@@ -24,10 +24,10 @@ final class PhabricatorAuthStartController
|
||||
return $this->processConduitRequest();
|
||||
}
|
||||
|
||||
if ($request->getCookie('phusr') && $request->getCookie('phsid')) {
|
||||
if (strlen($request->getCookie(PhabricatorCookies::COOKIE_SESSION))) {
|
||||
// The session cookie is invalid, so clear it.
|
||||
$request->clearCookie('phusr');
|
||||
$request->clearCookie('phsid');
|
||||
$request->clearCookie(PhabricatorCookies::COOKIE_USERNAME);
|
||||
$request->clearCookie(PhabricatorCookies::COOKIE_SESSION);
|
||||
|
||||
return $this->renderError(
|
||||
pht(
|
||||
@@ -71,8 +71,12 @@ final class PhabricatorAuthStartController
|
||||
}
|
||||
|
||||
if (!$request->isFormPost()) {
|
||||
$request->setCookie('next_uri', $next_uri);
|
||||
$request->setCookie('phcid', Filesystem::readRandomCharacters(16));
|
||||
$request->setCookie(
|
||||
PhabricatorCookies::COOKIE_NEXTURI,
|
||||
$next_uri);
|
||||
$request->setCookie(
|
||||
PhabricatorCookies::COOKIE_CLIENTID,
|
||||
Filesystem::readRandomCharacters(16));
|
||||
}
|
||||
|
||||
$not_buttons = array();
|
||||
|
||||
Reference in New Issue
Block a user