Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter logout function in model
#1

[eluser]Unknown[/eluser]
Hello,

it is possible to make a logout function in model only with session destroy or it is recommended to unset all session data and make session destroy?

Current function
Code:
function close_auth()
{
$this->session->destroy();
}

In Controller i call function like this:
Code:
$this->auth->close_auth();

Thank you for your help! :-)
Tomas
#2

[eluser][email protected][/eluser]
You can use the following for login :
Code:
$this->session->set_userdata('loggedin', TRUE);

and for logout :
Code:
$this->session->set_userdata('loggedin', FALSE);




Theme © iAndrew 2016 - Forum software by © MyBB