-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: delete_cookie() helper not working #4149
Comments
I cannot reproduce. |
it's just one of method I used to delete cookie, I've been just used delete_cookie('key1'); but not working at all |
set_cookie('key', 'value', 'expire') equal setcookie('key', 'value', 'expire') set_cookie() and delete_cookie() work the same set_cookie/delete_cookie -> Responce -> collecting data in array -> pass data from array to setcookie If you can set cookies using the set_cookie() function, then there will be no problems with deleting. |
I've used set_cookie() and clear with delete_cookie() thousand times, but when I check with d(get_cookie('key1')); or check in tab application of delevopers tools in google chrome, the cookie is still available |
Setting/deleting cookies are made in the Read further: #3939 |
finally I could delete the cookie, deleting cookie made in response header when using withCookies() function. I tried using that function when redirect to another page. this code I use : |
Direction
Describe the bug
I tried use cookie, and I succeed to make it, but when I tried to delete session not working, I tried some method that I found in forum but still not working.
CodeIgniter 4 version
CI4 v.4.0.4 and CI4 development
Affected module(s)
Expected behavior, and steps to reproduce if appropriate
this code to set cookie
set_cookie('key1', $cek_user['id'], 3600);
this code to delete cookie I tried
setcookie('key1', '', time() - 3600);
delete_cookie('key1');
$this->response->deleteCookie('key1');
$this->response->setCookie(['name' => 'key1', 'value' => "", 'expire' => '- 3600']);
set_cookie('key1', '', time() - 3600);
Context
The text was updated successfully, but these errors were encountered: