Last modified: 2012-04-12 13:53:46 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 T28324, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 26324 - Hidetoc cookies should set path
Hidetoc cookies should set path
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
1.16.x
All All
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 24415
  Show dependency treegraph
 
Reported: 2010-12-13 18:01 UTC by Dan Barrett
Modified: 2012-04-12 13:53 UTC (History)
2 users (show)

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


Attachments

Description Dan Barrett 2010-12-13 18:01:24 UTC
I clicked the "hide" link on a Table Of Contents, then clicked "show" sometime later. However, my tables of contents are still getting hidden intermittently. I keep clicking "Show", which shows the TOC, but sometime later they are hidden again. Examining my cookies, I see FOUR cookies called "hidetoc", each with a different path. I'll bet this cookie is being set incorrectly, and that the problem is related to subpage URLs.

The cookies are:

Path = /wiki/
Content = 1

Path = /wiki/User:Danb/
Content = 1

Path = /wiki/User:Danb/status/
Content = 1

Path = /wiki/User:Danb/pitches/
Content = 0

This is on Firefox 3.6.13 on Windows 2008 Server.
Comment 1 Platonides 2010-12-13 18:37:43 UTC
Sure it is. The toggleToc() code is doing just document.cookie = "hidetoc=1".
"If [path is] not specified, defaults to the current path of the current document location". so your assessment is right.

I think we should do instead:
document.cookie = 'hidetoc=7; path=' + escape( wgArticlePath.replace("$1", "") );

(note that I use escape because it leaves / untranslated but escapes ;, not sure if there may be any other dangerours characters)
Comment 2 Krinkle 2010-12-13 19:05:43 UTC
During the rewrite of mediawiki.legacy (of which wikibits.js' toggleToc is a part of) this will be taken care off.
Comment 3 Krinkle 2010-12-13 19:08:03 UTC
Adding to resourceloader tracking.
Comment 4 Krinkle 2010-12-24 00:58:39 UTC
Fixed in r78941.

Cookie is now set domain wide instead of just the local path.

The bug that caused the TOC-setting to only apply to the current article or subpage - and being inconsistent depending on the view (ie. action=purge from scriptpath was different then viewing the same article from articlepath ("/w/"index.php?title=This vs. "/wiki/"This ) – is now fixed.

Should be live on translatewiki.net tomorrow.

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


Navigation
Links