mediawiki.* modules should be using the new mediawiki.cookie module (added per T51156) instead of jquery.cookie. It provides correct defaults for cookie domain, path and expiration.
Offenders in core include mediawiki.toc, mediawiki.user, mediawiki.action.edit.collapsibleFooter, mediawiki.special.changeslist.legend.js.
Right now none of them respects cookie prefix, none of them handles the domain or path correctly (some use path: '/'), and none of them use the correct expiration time.