how to logout in php using codeignter

Uday Patil
Uday Patil used Ask the Experts™
on
how to logout in php using codeignter
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Marco GasiFreelancer
Top Expert 2010
Commented:
I suggest you to carefully read this article which explains how to write a good question.
First we can just try to give you a solution you should explain how are your session structured, how do you initialize a session, what 3rd party library (if one) you are using to manage login and logout, show us the code (if it exists) you are trying to use to get the job done.

Just repeating the question title is not enough to help us to help you, sorry.
Most Valuable Expert 2011
Top Expert 2016
Commented:
It might be as simple as this:
$this->session->delete('User');
$this->session->destroy();

Open in new window

But here's the problem with CodeIgniter.  It's so old and outdated that it does not even contain its own way of supporting login and logout functionality.  So as a result, every CodeIgniter installation may be different in this area.  You will have to figure it out for yourself, in your own installation.

If you want to see some of the theory behind the idea of a "logged in user" this article may help.
https://www.experts-exchange.com/articles/2391/PHP-Client-Registration-Login-Logout-and-Easy-Access-Control.html

Best answer: Get rid of CodeIgniter.  Instead, choose Laravel.  You can thank us later.
Most Valuable Expert 2011
Top Expert 2016

Commented:
abandoned question

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial