[Mediawiki-l] Multiple wikis - dealing with cookies

Joshua Yeidel yeidel at wsu.edu
Tue Mar 28 03:12:29 UTC 2006

You can use the $wgCookiePath.  This variable is set in LocalSettings.php,
and in turn sets a property of the cookie.  When the cookie path matches
(from left-to-right) the URL of a request, the browser sends the cookie
along with that request.

For example, if you have two wikis:




Then you set the $wgCookiePath to "/wiki1" in wiki1/LocalSettings.php, and
to "/wiki2" in wiki2/LocalSettings.php.  Then each wiki never sees the
other's cookies.

Note:  This is good in theory, but untested (though we're working on it).
The situation is more complex if you are using mod_rewrite or other
short-URL tricks.  There may also be an issue with PHPSESSIONID and its
cookies.  Others on the list may know more...

-- Joshua

On 3/27/06 5:52 PM, "Sy Ali" <sy1234 at gmail.com> wrote:

> On 3/27/06, Joshua Yeidel <yeidel at wsu.edu> wrote:
>> It's not clear that multiple MediaWiki's _can_ share the same user cookie if
>> you are using the login code as-shipped.
> This isn't a big enough issue to warrant my going overboard to solve it.
> Ok, so how do I force the different mediawiki installs to use separate
> cookies, to ensure that they don't clobber oneanother?
> It does appear to me that something fishy is going on.. because
> although I don't clear my cookies and have mw remember my password..
> sometimes I have to re-log in.
> It's not consistant.. so I'm still confused as to what's going on.
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at Wikimedia.org
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l

More information about the MediaWiki-l mailing list