mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-04-26 01:57:21 -05:00
The FCCDCF cookie frequently goes oversize, and has recently been causing people to be unable to access PS because their total cookie size is going over 8KB, above Apache's default maximum. https://business.safety.google/adscookies/ It looks like this cookie is set by Google and, according to the internet, sometimes gets filled with junk? I don't know of an easy way to fix this, but I'm hoping this does it.
22 lines
647 B
PHP
22 lines
647 B
PHP
<?php
|
|
|
|
error_reporting(E_ALL);
|
|
ini_set('display_errors', TRUE);
|
|
ini_set('display_startup_errors', TRUE);
|
|
|
|
$cleaned = false;
|
|
|
|
foreach ($_COOKIE as $name => $value) {
|
|
if (strlen($value) > 3000) {
|
|
setcookie($name, '', time()-1000, '/', 'play.pokemonshowdown.com');
|
|
setcookie($name, '', time()-1000, '/', '.play.pokemonshowdown.com');
|
|
setcookie($name, '', time()-1000, '/', 'pokemonshowdown.com');
|
|
setcookie($name, '', time()-1000, '/', '.pokemonshowdown.com');
|
|
$cleaned = true;
|
|
}
|
|
}
|
|
|
|
if ($cleaned) {
|
|
echo 'alert("You had a cookie which was too big to handle and had to be deleted. If you had cookie settings, they may not be right.")';
|
|
}
|