Index: includes/Setup.php
===================================================================
--- includes/Setup.php	(revision 21546)
+++ includes/Setup.php	(working copy)
@@ -134,6 +134,7 @@
 } else {
 	$wgCookiePrefix = $wgDBname;
 }
+$wgCookiePrefix = strtr($wgCookiePrefix, "=,; +.\"'\\[", "__________");
 
 # If session.auto_start is there, we can't touch session name
 #
