Welcome Guest, Not a member yet? Register   Sign In
Problem with delete session
#1

(This post was last modified: 12-03-2022, 06:44 AM by motoroller.)

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

helper('cookie');

set_cookie([
'name' => 'country',
'value' => '',
'expire' => -25800,
]);

session()->destroy();

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?
Reply
#2

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

You can also try clearing out the data array.

PHP Code:
$data = [];

$session->set($data);

session()->destroy(); 
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB