[eluser]thesleepydog[/eluser]
hello,
This is my first post and I just wanted to say that this forum is a wealth of knowledge. I'm fairly experienced with HTML and CSS. I'm pretty good with PHP as well. I'm fairly new to CI and MVC but I like what I've seen so far.
That being said...here is my problem. I'm using SimpleLoginSecure and sessions stored in a database. I'm under the impression that when I use the logout function for SimpleLoginSecure which calls sess_destroy that the row in my database will be deleted. This is not the case. Any help is much appreciated. My code is listed below.
session config
Code:
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_expire_on_close'] = TRUE;
$config['sess_encrypt_cookie'] = FALSE;
$config['sess_use_database'] = TRUE;
$config['sess_table_name'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;
function from controller
Code:
public function logout()
{
$this->user_model->logout();
//redirect to login screen
redirect('/user/login', 'refresh');
}
function from model
Code:
public function logout()
{
//use simpleloginsecure to destroy session and update database session table
$this->simpleloginsecure->logout();
}
function from simpleloginsecure
Code:
function logout() {
$this->CI =& get_instance();
$this->CI->session->sess_destroy();
}
and for reference the sess_destroy function
Code:
/**
* Destroy the current session
*
* @access public
* @return void
*/
function sess_destroy()
{
// Kill the session DB row
if ($this->sess_use_database === TRUE AND isset($this->userdata['session_id']))
{
$this->CI->db->where('session_id', $this->userdata['session_id']);
$this->CI->db->delete($this->sess_table_name);
}
// Kill the cookie
setcookie(
$this->sess_cookie_name,
addslashes(serialize(array())),
($this->now - 31500000),
$this->cookie_path,
$this->cookie_domain,
0
);
}