CodeIgniter Forums
Problem with delete session - Printable Version

+- CodeIgniter Forums (
+-- Forum: CodeIgniter 4 (
+--- Forum: CodeIgniter 4 Support (
+--- Thread: Problem with delete session (/showthread.php?tid=85123)

Problem with delete session - motoroller - 12-03-2022

i Have logout controller like this, my sessions stored in Redis


'name' => 'country',
'value' => '',
'expire' => -25800,


return redirect()->to('/')->withCookies();

After logout cookies are destroyed, but session still alive if I do next:

return redirect()->to('/');
session is destroyed, but cookies are still alive, how completle destroed cookies and session and one controller?

RE: Problem with delete session - cesartnic - 12-03-2022

yo can try this:
first you need clear cache browser,
then use get cookie for verify if exist the cookie.

RE: Problem with delete session - InsiteFX - 12-05-2022

You can also try clearing out the data array.

PHP Code:
$data = [];