Welcome Guest, Not a member yet? Register   Sign In
My ci_sessions table is empty?
#1

(This post was last modified: 04-18-2015, 02:09 PM by lexxtoronto.)

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.
Do the one thing you think you cannot do. Fail at it. Try again. Do better the second time. The only people who never tumble are those who never mount the high wire.
Reply
#2

(This post was last modified: 04-18-2015, 02:34 PM by lexxtoronto.)

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?
Do the one thing you think you cannot do. Fail at it. Try again. Do better the second time. The only people who never tumble are those who never mount the high wire.
Reply
#3

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

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

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?
Do the one thing you think you cannot do. Fail at it. Try again. Do better the second time. The only people who never tumble are those who never mount the high wire.
Reply
#6

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

Thank you guys! I was changing the wrong config.php, I forgot I had the right config.php in development folder! It works now.
Do the one thing you think you cannot do. Fail at it. Try again. Do better the second time. The only people who never tumble are those who never mount the high wire.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB