Welcome Guest, Not a member yet? Register   Sign In
Extending the Session Library - I need to specify database to store sessions in.
#1

[eluser]Jaketoolson[/eluser]
I want to store my session activity in the database. I've updated my config file to reflect these changes:
Code:
$config['sess_encrypt_cookie']    = TRUE;
$config['sess_use_database']    = TRUE;
$config['sess_table_name']        = 'users_sessions';
$config['sess_time_to_update']    = 50;

The problem I'm having is my website utilizes more than 1 database, and I need to specify which database the sessions should be stored to. I tried extending the session library but it didn't do a thing:

Code:
class MY_Session extends CI_Session
{
    var $database_name    = 'site_schema';    //database name
    function __construct()
    {
        parent::__construct();
        if ($this->sess_use_database === TRUE AND $this->sess_table_name != '')
        {
            $this->CI->load->database($this->database_name,TRUE);
        }
    }
}


Messages In This Thread
Extending the Session Library - I need to specify database to store sessions in. - by El Forum - 03-03-2011, 11:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB