Page MenuHomePhabricator

For logged-in users, store that they've consented to the CC0 licence in local storage or a hidden user preference rather than a cookie
Closed, ResolvedPublic

Description

The current code for not showing the CC0 warning on the file page uses a cookie, whether you're logged in or logged out.

For logged-out users a cookie is as good as we can provide, but for logged-in users we should instead use a local storage or a hidden preference. This would mean that logged-in users wouldn't get re-warned when they clear their cookies. If we go with a hidden user preference, they also wouldn't get re-warned when they use a different browser.

Event Timeline

I have a fix in progress, but I'm having some difficulty getting the value saved in the DB for logged-in users (storing in localstorage works fine). I'm attempting to use mw.Api.plugin.options.saveOption() but I keep getting a TypeError response from the server for some reason...

Change 494766 had a related patch set uploaded (by Eric Gardner; owner: Eric Gardner):
[mediawiki/extensions/WikibaseMediaInfo@master] Store user CC0 license agreement in localstorage or userprefs

https://gerrit.wikimedia.org/r/494766

This patch has passed CI and is ready for a final code review pass.

Change 494766 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Store user CC0 license agreement in localstorage or userprefs

https://gerrit.wikimedia.org/r/494766

Tested on 4/23 by confirming CC0 notice did not appear while logged in even on a different computer.