Session to Database + Multiple Database |
[eluser]Unknown[/eluser]
Hello, I want now that the sessions will be save in my database. But my default database is not my database for stuffs like ci_sessions. I found this: Tutorial So I edited the Session.php in system/lib with: Code: // Are we using a database? If so, load it But the system still want connect to my default database :/ Someone a solution to get the session_db on my stuff_database? Thanks ![]() Sanjo
[eluser]XMadMax[/eluser]
Samjo, Code: $this->CI->load->database('stuff', TRUE); This load the stuff configuration, and returns the pointer to this connection. You must use: Code: $this->stuffdb = $this->CI->load->database('stuff', TRUE); And use $this->stuffdb instead of $this->db Also, another solution would be to create a db function inside session. When $this->db are called, you can return your own database, instead of default database. Xavier |
Welcome Guest, Not a member yet? Register Sign In |