$elem){ if(!isset($elem['acct'])){ continue; } if ($key == $cookie['index']){ continue; } $ncookie[$c] = $elem; $c++; } setrawcookie("user_settings",base64_encode(json_encode($ncookie)),time()+60*60*24*30,'/'); $c = 0; $tokens = json_decode(base64_decode($_COOKIE['token']),true); for ($i=0;$i<=(count($tokens)-1);$i++){ if ($i == $cookie['index']){ continue; } $ntoken[$c] = $tokens[$i]; $c++; } setcookie('token', base64_encode(json_encode($ntoken)), time() + 60 * 60 * 24 * 30, $cdata['path'], $cdata['host'], false, true); header('Location: '.$setting['url']);