Cookies are deleterious to site performance because they hurt cache efficiency and because they bloat payload size. The bloat added by cookies is significant despite their relatively small byte size due to TCP slow-start.
We should go over all cookies and work to eliminate as many of them as possible. At the time of writing (26-Aug-2015), localStorage is available for 92.76% of traffic. MediaWiki extensions which currently rely on cookies could use localStorage instead, except when the adverse effect on the user would be extremely high (for instance, the site would be unusable for a user if fundraising CentralNotices were displayed unconditionally).
Documented at: https://www.mediawiki.org/wiki/Performance_guidelines#Cookies
Overview of cookies found on Wikimedia wikis as of 2017-02-27
All page loads (all wikis, all users, logged-in and logged-out)
Name | Source | Purpose | Expiry | Comment |
---|---|---|---|---|
CP (all-frontend) | Varnish | Connection properties (e.g. HTTP/1.1 vs HTTP/2) | Session | No longer used. Removed. |
GeoIP | Varnish (text-frontend) | Geo-location for CentralNotice banners | Session | Keep. Only known server-side, needed client-side. |
WMF-Last-Access (all-frontend) | Varnish | Analytics | 32 days | Keep. Used server-side (HttpOnly). |
WMF-Last-Access-Global (all-frontend) | Varnish | Analytics | 32 days | Keep. Used server-side (HttpOnly). |
Most page loads (conditional, but possible on all wikis, all users)
Name | Source | Purpose | Expiry | Comment |
---|---|---|---|---|
<wiki-id>mwuser-sessionId | mediawiki.js | Generic client-side session id | Session | Moved to sessionStorage. https://gerrit.wikimedia.org/r/340236 (1.29.0-wmf.15) |
mediawikiwikiGeoFeaturesUser2 | WikimediaEvents JS | User token | 10 minutes | Moved to sessionStorage. https://gerrit.wikimedia.org/r/340232 (1.29.0-wmf.14) |
dismissSiteNotice | DismissableSiteNotice JS | Seen state | 30 days | Unsure.. |
centralnotice_hide_* | CentralNotice JS | Seen state | 7 days | Moving to localStorage. T108849 |
centralnotice_hide_fundraising | CentralNotice JS | Seen state | 250 days | Moving to localStorage. T108849 |
Editing
Name | Source | Purpose | Expiry | Comment |
---|---|---|---|---|
centralauth_Session | CentralAuth PHP | SUL | Session | Keep. Needed server-side for central login (shared by multiple subdomains by CentralAuth; HttpOnly). |
centralauth_Token | CentralAuth PHP | SUL | Configurable | Unsure. Used server-side by CentralAuth. (HttpOnly) |
centralauth_User | CentralAuth PHP | SUL | Configurable | Unsure. Used server-side by CentralAuth. (HttpOnly) |
forceHTTPS | MediaWiki PHP | 30 days | Unsure. Used by CentralAuth? (HttpOnly). | |
<wiki-id>Session | MediaWiki PHP | Login/Session | Session | Keep. Needed server-side for user log-in and other session logic (MediaWiki core; HttpOnly). |
<wiki-id>UserID | MediaWiki PHP | non-SUL Login | Configurable | Unsure. Used for "remember me"? (HtttpOnly) |
<wiki-id>Token | MediaWiki PHP | non-SUL Login | Configurable | Unsure. Used for "remember me"? (HtttpOnly) |
<wiki-id>UserName | MediaWiki PHP | Configurable | Unsure. (HtttpOnly) | |
<wiki-id>templates-used-list | MediaWiki JS | Collapse/expand state | 30 days | Moved to localStorage. https://gerrit.wikimedia.org/r/340243 (1.29.0-wmf.15) |
VEE | VisualEditor JS + PHP | Preferred editor mode | 30 days | Move to localStorage? Currently used server-side for logged-in users as well. Maybe be movable to user pref system. See T181933. |
See also: