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 :: error in laravel 
Php :: blade condition if else laravel 
Php :: laravel query select from table where id != to another table id 
Php :: get last word from string php 
Php :: current url wordpress 
Php :: install php 8 ubuntu 
Php :: wordpress max post revision 
Php :: self submit form php 
Php :: get current month records in laravel 
Php :: wordpress is home page 
Php :: php random integer 
Php :: merge two query results in laravel 
Php :: Installation request for phpoffice/phpspreadsheet 1.4.0 - satisfiable by phpoffice/phpspreadsheet[1.4.0] 
Php :: item count in cart quantitiy woocommerce 
Php :: laravel db query 
Php :: php combine arrays 
Php :: header refresh page php 
Php :: laravel disable csrf token 
Php :: laravel collection orderby 
Php :: laravel create text file 
Php :: migrations required field laravel 
Php :: ubuntu fopen failed to open stream: Permission denied 
Php :: php server sent events 
Php :: base url laravel 
Php :: no privileges to create databases phpmyadmin 
Php :: set unique value validation for laravel form request 
Php :: laravel csrf token off 
Php :: php auto redirect 
Php :: eloquent pluck multiple columns 
Php :: laravel delete file after download 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =