Welcome Guest, Not a member yet? Register   Sign In
Could not save session to the DB
#1

[eluser]Nicholas Hanks[/eluser]
I have been trying to make this simple script work. But no matter what I try it is not working. Anybody can give me some insight.
Code:
if($user->password === hash('sha256', $user->salt.$password))
{
    $currTime = date('Y-m-d H:i:s', now());
    $ip = $_SERVER['REMOTE_ADDR'];
    $ip = ip2long($ip);
    $this->db->where('id', $user->id);
    $this->db->update('users', array('last_login' => $currTime, 'logged_in_from' => $ip));
    //Apparently this is not working not even with array
    $this->session->set_userdata('loggedIn',true);
    return true;
}
else
{
    return false;
}

Code:
//config.php
$config['sess_cookie_name']    = 'session';
$config['sess_expiration']    = 7200;
$config['sess_expire_on_close']    = FALSE;
$config['sess_encrypt_cookie']    = TRUE;
$config['sess_use_database']    = true;
$config['sess_table_name']    = 'sessions';
$config['sess_match_ip']    = FALSE;
$config['sess_match_useragent']    = TRUE;
$config['sess_time_to_update']    = 300;

Nothing is getting saved in session table as well. I never had this weird problem before.




Theme © iAndrew 2016 - Forum software by © MyBB