Filippo oretti
Filippo oretti

Reputation: 49843

How to delete all sessions and cookies

I'm wondering if is there any way to remove all domain site cookies and sessions params.

somenthing like $this->session->destroy();?

Upvotes: 1

Views: 22021

Answers (3)

Usama Jalal
Usama Jalal

Reputation: 155

In CodeIgniter 4, If you want to delete all your session data along with index/key then you can use this:

$this->session->destroy();

Upvotes: 0

Shariati
Shariati

Reputation: 119

Just to note for applications where post destroying session, you want user to land on the index page where that point forward is taken care of the function, use bellow,

$this->session->sess_destroy();
redirect('');

Upvotes: 1

chovy
chovy

Reputation: 75774

$this->session->sess_destroy()

Upvotes: 15

Related Questions