Last modified: 2014-11-14 01:44:10 UTC
mediawiki.* modules should be using the new mediawiki.cookie module (added per bug 49156) instead of jquery.cookie. It provides correct defaults for cookie domain, path and expiration. It also respects $wgCookiePrefix, which can cause issues when migrating. It doesn't look like the JavaScript code which uses cookies is critical enough for us not to be able to just switch to the new names directly. Offenders in core include mediawiki.toc, mediawiki.user, mediawiki.action.edit.collapsibleFooter, mediawiki.special.changeslist.legend.js. Right now none of them respects cookie prefix, none of them handles the domain or path correctly (some use path: '/'), and none of them use the correct expiration time.
It's possible to use mediawiki.cookie without changing the cookie names (e.g. for back-compat, or temporarily). All the settings are overridable. Changing the name without backwards compatibility should not be an issue for the simple UI ones (e.g. TOC) (it will be slightly annoying once per UI item, which is acceptable). However, many of these may be better suited for localStorage. We have a wrapper for this, jStorage (side not, jStorage does not handle wgCookiePrefix, so it has to be done manually), which uses localStorage or various fallbacks. Avoiding cookies in such cases (where the server doesn't need the data) saves bandwidth. If it seems relevant to analytics (e.g. 'mediawiki.user.bucket', 'mediaWiki.user.sessionId', etc.), please notify the analytics list (https://lists.wikimedia.org/mailman/listinfo/analytics) before it's merged, so if someone has an experiment in progress, they can coordinate. Finally, it's completely expected that there will be overrides for duration; the most common use case for this is a session cookie (null duration).
> the most common use case for this is a session cookie (null duration). Many other examples (e.g. 30 days from changeslist) should probably use wgCookieExpiration, though.
Unsubscribing, but feel free to add me to code review on this.