Page MenuHomePhabricator

Inconsistent behaviour of mw.centralNotice.customHideBanner
Open, Needs TriagePublic

Description

Steps to reproduce:

  • In an incognito window, visit aa.wikipedia.org where we have a test campaign running
  • Click close button, which has mw.centralNotice.customHideBanner( 'close', 3600 ); attached to it
  • View cookies set in browser console

Expected result:

  • Cookie centralnotice_hide_fundraising set for .wikipedia.org with expiry 1 hour in future

Actual result

  • Cookie above is set, but also have cookie centralnotice_hide_fundraising for aa.wikipedia.org with a longer expiry

Event Timeline

This isn't urgent, I worked around it in the banners we want to test by just adding my own simplified function which only sets a cookie for the current domain. Curious though.

Hi! Thanks for this... I tried this with the campaign currently on aa.wikipeda.org. When I clicked the close button, I got two cookies, one for .wikipedia.org and another for aa.wikipedia.org. The first one had the correct expiry time, but the second one had a much longer expiry.

However, when I reset cookies and visited the site again, and this time I pasted mw.centralNotice.customHideBanner( 'close', 3600 ); into the console, both cookies got the correct expiry time.

Also to note, internally CN is currently using $.cookie, but for a while I think it's been suggested that we use mw.cookie instead, which has really the same functionality.

Thanks again!!!