User talk:Patrick Nagel/Login with snoopy post-1.15.3

Instead of:
 * $snoopy->cookies["wiki_session"] = $response[login][sessionid];

I used:
 * $snoopy->cookies = getCookieHeaders($snoopy->headers);

and the function getCookieHeaders is: function getCookieHeaders($headers){ $cookies = array; foreach($headers as $header) if(preg_match("/Set-Cookie: ([^=]*)=([^;]*)/", $header, $matches)) $cookies[$matches[1]] = $matches[2]; return $cookies; }
 * 1) This function parses Snoopy's header array and returns a nice array of cookies

It works better because you don't have to know the name of the cookie in advanced. (I took the function from http://www.mail-archive.com/mediawiki-api@lists.wikimedia.org/msg00099.html)