Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php remove cookie

if (isset($_COOKIE['key'])) {
    unset($_COOKIE['key']);
    setcookie('key', '', time() - 3600, '/'); // empty value and old timestamp
}
Comment

remove cookies php

unset($_COOKIE['hello']);
Comment

delete all cookies in php

// unset cookies
if (isset($_SERVER['HTTP_COOKIE'])) {
    $cookies = explode(';', $_SERVER['HTTP_COOKIE']);
    foreach($cookies as $cookie) {
        $parts = explode('=', $cookie);
        $name = trim($parts[0]);
        setcookie($name, '', time()-1000);
        setcookie($name, '', time()-1000, '/');
    }
}
Comment

PREVIOUS NEXT
Code Example
Php :: create laravel project 8.16.1 
Php :: php strict-origin-when-cross-origin 
Php :: PHP Warning: require(/vendor/autoload.php): failed to open stream: No such file or directory in /var/www/api-fase/bootstrap/autoload.php on line 17 
Php :: view a pdf file in the browser using the php header function 
Php :: hide php extension htaccess 
Php :: php delete all files in folder 
Php :: php add hours to current date 
Php :: php array remove empty values 
Php :: delete image from public folder in laravel 
Php :: wp_query count result 
Php :: get image extension in php 
Php :: close mysql connection in php 
Php :: laravel check if in production 
Php :: mysql replace a character in a string 
Php :: row count in codeigniter 
Php :: php get subdomain 
Php :: get custom field 
Php :: laravel make trait command 
Php :: beaver builder shortcode post title 
Php :: button back php 
Php :: auth pages not getting css in laravel 
Php :: install php7.4 in linux server 
Php :: superglobal php 
Php :: time to load php page 
Php :: php pdo get database name 
Php :: php sha256 example 
Php :: laravel time format 
Php :: pretty show php arrays 
Php :: phpMyAdmin is not able to cache templates 
Php :: force https redirection laravel 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =