php - delete_cookies() helper not working in codeigniter 4Get the solution ↓↓↓
I want to create a remember me feature on my website using cookie. when the user logout i want to destroy all session and cookies. But the problem is i can't delete existing cookie.
i'am using CodeIgniter 4 framework
i already loaded cookie helper in my BaseController. i tried this code in my logout controller :
but that doesnt work, and also i tried this one :
set_cookie('remember_me_token', '', - 1209600); // set to minus
and the result is the same, i can't delete the cookie
please help :(
I followed up with a different approach using the setCookie function which was chained using the response and simply set the expiry time to -1.
$this->response->setCookie(['name' => 'token','value' => "" ,'expire' => '-1','domain' => $domain, 'path' => '/'])
Share solution ↓
Link To Answer People are also looking for solutions of the problem: the metadata storage is not up to date, please run the sync-metadata-storage command to fix this issue.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.