pokemon-showdown-client/play.pokemonshowdown.com/js/clean-cookies.php
Guangcong Luo 5d41f3ec93
Reorganize directories (#2187)
Files meant to be served have been moved into
`play.pokemonshowdown.com/` and `pokemonshowdown.com/`.

We now have three directories for the three subdomains handled by this
repo:

- `pokemonshowdown.com/`
- `play.pokemonshowdown.com/`
- `replay.pokemonshowdown.com/`

Naming them after the subdomains will make it much easier to tell where
the files for each go.

The diff is probably useless; it'll be easier if you just look at the
new tree:
https://github.com/smogon/pokemon-showdown-client/tree/reorganize
2023-11-16 03:39:29 -08:00

22 lines
652 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 have been deleted.")';
}