Last modified: 2014-05-16 21:38:56 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 49156 - Add mediawiki.cookie module to allow reading and writing cookies with correct settings
Add mediawiki.cookie module to allow reading and writing cookies with correct...
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
All All
: Low enhancement (vote)
: 1.24.0 release
Assigned To: Sam Smith
Depends on: 49154
Blocks: code_quality 61979
  Show dependency treegraph
Reported: 2013-06-04 20:53 UTC by Matthew Flaschen
Modified: 2014-05-16 21:38 UTC (History)
8 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Matthew Flaschen 2013-06-04 20:53:16 UTC
We should add a mediawiki.cookie module to correctly read (though this case is trivial) and write cookies with the right settings.  We have six variables controlling this ($wgCookiePath, $wgCookiePrefix, $wgCookieDomain, $wgCookieSecure, $wgCookieExpiration, $wgCookieHttpOnly).  Only wgCookiePrefix is currently exposed.

Requiring code to use jQuery.cookie directly means they generally get these settings wrong, and sometimes don't set the path at all (meaning it will often fork into /w/ and /wiki/, and perhaps more).

We should provide a write wrapper that's as close to WebResponse->setcookie as possible, with necessary exceptions (e.g. HTTP-only doesn't make sense, since it wouldn't work).  A read wrapper is useful for convenience, so you can use the same module for both.
Comment 1 Gerrit Notification Bot 2014-03-31 13:37:32 UTC
Change 120806 had a related patch set uploaded by Phuedx:
[WIP] Add the mw.cookie module
Comment 2 Gerrit Notification Bot 2014-05-14 18:17:58 UTC
Change 120806 merged by Robmoen:
Implement mediawiki.cookie module
Comment 3 Matthew Flaschen 2014-05-15 06:24:23 UTC
I think this only needs to go in 1.24, unless someone needs it backported.

Note You need to log in before you can comment on or make changes to this bug.