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 :: laravel avoid logged in user to access a page 
Php :: laravel migration remove constraint 
Php :: php in array 
Php :: password hashing in laravel 
Php :: Notice: Undefined property: 
Php :: increase upload limit in phpmyadmin docker 
Php :: install php 7.4 ubuntu 
Php :: php rename files in directory 
Php :: boot method laravel life cycle 
Php :: laravel query get big table records 
Php :: php artisan drop table 
Php :: remove first character from string laravel 
Php :: using laravel back function on blade 
Php :: laravel limit query pagination 
Php :: wordpress disable file mods 
Php :: default php program 
Php :: php mysql if exists 
Php :: Invalid argument supplied for foreach() 
Php :: php check if date is bigger than today 
Php :: php add to associative array 
Php :: php clean all output buffers 
Php :: Allowed memory size of 33554432 bytes exhausted (tried to allocate 43148176 bytes) in php 
Php :: server error in laravel 
Php :: php __construct 
Php :: laravel nigerian time zone 
Php :: php select from database into array 
Php :: php count amount of times a value appears in array 
Php :: How to display image from aws s3 in laravel blade 
Php :: json url decode php 
Php :: symfony password 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =