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

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T51156, the corresponding Phabricator task for complete and up-to-date bug report information.
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...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.22.0
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: ---


Attachments

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

https://gerrit.wikimedia.org/r/120806
Comment 2 Gerrit Notification Bot 2014-05-14 18:17:58 UTC
Change 120806 merged by Robmoen:
Implement mediawiki.cookie module

https://gerrit.wikimedia.org/r/120806
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.


Navigation
Links