mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-03-21 17:50:29 -05:00
Workaround for large cookies
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.
This commit is contained in:
parent
ed36b96882
commit
7c18649859
|
|
@ -124,4 +124,5 @@ https://psim.us/dev
|
|||
<script src="//play.pokemonshowdown.com/js/battle-dex-search.js?"></script>
|
||||
<script src="//play.pokemonshowdown.com/js/search.js?"></script>
|
||||
|
||||
<script src="//play.pokemonshowdown.com/data/aliases.js?" async="async"></script>
|
||||
<script src="//play.pokemonshowdown.com/data/aliases.js?" async></script>
|
||||
<script src="//play.pokemonshowdown.com/js/clean-cookies.php" async></script>
|
||||
|
|
|
|||
21
js/clean-cookies.php
Normal file
21
js/clean-cookies.php
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<?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.")';
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user