We should add a mediawiki.cookie module to correctly read (though this case is trivial) and write cookies with the right settings. We have six variables controlling this ($wgCookiePath, $wgCookiePrefix, $wgCookieDomain, $wgCookieSecure, $wgCookieExpiration, $wgCookieHttpOnly). Only wgCookiePrefix is currently exposed.
Requiring code to use jQuery.cookie directly means they generally get these settings wrong, and sometimes don't set the path at all (meaning it will often fork into /w/ and /wiki/, and perhaps more).
We should provide a write wrapper that's as close to WebResponse->setcookie as possible, with necessary exceptions (e.g. HTTP-only doesn't make sense, since it wouldn't work). A read wrapper is useful for convenience, so you can use the same module for both.