CodeIgniter Forums
My ci_sessions table is empty? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: My ci_sessions table is empty? (/showthread.php?tid=61481)



My ci_sessions table is empty? - lexxtoronto - 04-18-2015

I set it in config.php

$config['sess_use_database'] = TRUE;
$config['sess_table_name'] = 'ci_sessions';

And set up a table in my database as ci_sessions. I'm able to retrieve session data via $this->session->all_userdata() so it sets session data locally, but my ci_sessions table is empty.

I load session library, set up config, am I missing anything else? It supposed to populate ci_sessions table automatically, right? Im not unsetting any session data yet.

Database is working fine, Im able to retrieve some other data, and load database in my login constructor.


RE: My ci_sessions table is empty? - lexxtoronto - 04-18-2015

Hang on a second Smile I have to write a query to store session data in the db? I think it retrieves and matches automatically, but doesnt store automatically?


RE: My ci_sessions table is empty? - gadelat - 04-18-2015

Is your $config['sess_driver'] set to 'datababase'?


RE: My ci_sessions table is empty? - CroNiX - 04-18-2015

Which version of CI are you using? v2 and v3 are slightly different on how you set up db sessions.


RE: My ci_sessions table is empty? - lexxtoronto - 04-18-2015

CI 2. There is no config['sess_driver'], I have $config['sess_use_database'] = TRUE;

Well my question is - am I supposed to set session data in the database or CI does it automatically?


RE: My ci_sessions table is empty? - CroNiX - 04-18-2015

It does it automatically. What does your ci_sessions table look like? Are you autoloading your sessions in autoload.php or manually somewhere?


RE: My ci_sessions table is empty? - lexxtoronto - 04-18-2015

Thank you guys! I was changing the wrong config.php, I forgot I had the right config.php in development folder! It works now.