Page MenuHomePhabricator

Consolidate use of magical cookie name strings
ClosedPublic

Authored by epriestley on Jan 23 2014, 5:35 PM.
Tags
None
Referenced Files
F19081191: D8041.id.diff
Tue, Dec 2, 4:23 AM
F19069304: D8041.diff
Sun, Nov 30, 1:42 PM
F18840841: D8041.id.diff
Oct 28 2025, 4:14 AM
F18835168: D8041.diff
Oct 26 2025, 1:58 PM
F18830379: D8041.id.diff
Oct 25 2025, 6:38 AM
F18782913: D8041.diff
Oct 13 2025, 2:57 AM
F18772536: D8041.diff
Oct 9 2025, 3:02 AM
F18734563: D8041.id.diff
Sep 30 2025, 10:56 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.