cookie::remove PHP Method

remove() static public method

Remove a cookie
static public remove ( string $key, string $domain = '/' ) : mixed
$key string The name of the cookie
$domain string The domain of the cookie
return mixed true: the cookie has been removed, false: the cookie could not be removed
    static function remove($key, $domain = '/')
    {
        $_COOKIE[$key] = false;
        return @setcookie($key, false, time() - 3600, $domain);
    }

Usage Example

Example #1
0
 public static function logout()
 {
     session_regenerate_id();
     s::remove('auth.created');
     s::remove('auth.updated');
     s::remove('auth.key');
     s::remove('auth.secret');
     s::remove('auth.username');
     s::remove('auth.ip');
     s::remove('auth.ua');
     cookie::remove('key');
 }
All Usage Examples Of cookie::remove