Custom, conditional redirect on logout

You need to be sure that you have noted global $noCookiesLeft; before setting it in the if statement. It may be unset when it runs the no_cookie() function.