Page MenuHomePhabricator

Consolidate use of magical cookie name strings
ClosedPublic

Authored by epriestley on Jan 23 2014, 5:35 PM.
Tags
None
Referenced Files
F13177131: D8041.diff
Wed, May 8, 7:28 PM
Unknown Object (File)
Mon, Apr 29, 2:57 PM
Unknown Object (File)
Tue, Apr 16, 12:13 AM
Unknown Object (File)
Thu, Apr 11, 7:07 AM
Unknown Object (File)
Apr 9 2024, 2:46 AM
Unknown Object (File)
Apr 7 2024, 11:55 AM
Unknown Object (File)
Mar 29 2024, 6:17 PM
Unknown Object (File)
Mar 21 2024, 7:53 PM
Subscribers

Details

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.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

src/aphront/console/DarkConsoleDataController.php
61โ€“72

This fixes a small theoretical issue caused by the recent cookie prefix patch, where this filter could fail to strip session keys if you prefixed cookies.

src/applications/auth/controller/PhabricatorAuthController.php
116

This is a GET parameter to the login validation controller, which makes sure you logged in as the user we expect and that your cookies got set correctly. I changed the name to 'expect' to make it more clear that it is not directly handling the 'phcid' cookie.

src/applications/auth/controller/PhabricatorAuthStartController.php
27

This fixes two small user experience issues:

  • If the user had a bad phsid cookie, but no phusr cookie, we wouldn't enter this block, so they'd miss the useful message.
  • If the user had a bad phsid cookie with value "0", we wouldn't enter this block.
src/applications/auth/controller/PhabricatorLogoutController.php
36

For consistency, treat the session "0" as a real session, although it is vanishingly unlikely to be valid.

55

(Unrelated cleanup, these two versions display identically.)

src/applications/settings/panel/PhabricatorSettingsPanelSessions.php
43โ€“45

Fixes TODO, this table now has a real ID column.

Nice - thanks for all the comments too.