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.
- For an example of where we do the hidden-preference-with-fallback-to-local-storage method, see the maybeShowWelcomeDialog method in VisualEditor.
- For an example of where we do the hidden-preference-with-fallback-to-hidden-preference method, see the showCopyrightTooltip method in Wikibase. Note that you'll need to register the preference with MediaWiki as an "api" preference to avoid it showing up in Special:Preferences.