[dokuwiki] separate cookies for multiple wikis on the same site

  • From: "Sameer D. Sahasrabuddhe" <sameerds@xxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Sun, 26 Jun 2005 22:51:54 +0530


Here's a patch to take care of cookies when you have multiple wikis on the same site. Basically the wikis get confused since all of them use the identifier DokuWikiAUTH to identify the cookie.

I had tried using the "path" argument to "setcookie", but it didn't seem to work. Anyway the PHP documentation mentions that the path argument is not handled correctly by IE 4, so decided to try something else.

I replaced the name 'DokuWikiAUTH' with a constant DOKU_COOKIE. auth.php sets this constant to the md5 hash of $_SERVER['SCRIPT_NAME'] since that contains enough path information to make it unique on a particular site. I had tried using "urlencode" but that does not provide an acceptable cookie identifier according to the Netscape cookie spec. Using an md5 works quite well. I have two copies of a recent darcs version, both running side by side ... they no longer confuse the auth information stored in the cookies.

Research Scholar, KReSIT, IIT Bombay

Other related posts: