Welcome Guest, Not a member yet? Register   Sign In
Storing Sessions in DB not working
#1

[eluser]thody[/eluser]
Hey all,

I'm trying to get sessions stored in the db for my app, with no success. I have the DB set up, and have no problems connecting/querying it.

My session config is as follows:
Code:
$config['sess_cookie_name']    = 'session';
$config['sess_expiration']        = 7200;
$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;

I'm not seeing any entries going into the table, nor do I see any session related queries when I enable profiling.

Any thoughts?
#2

[eluser]mironcho[/eluser]
Hi Thody and welcome to the forums!
Do you load database and session libraries (database first)?
#3

[eluser]thody[/eluser]
Thanks!

Yes, I have database and session autoloading, with database first.
#4

[eluser]thody[/eluser]
One other quick note, I am able to set and retrieve data with $this->session->(set_)userdata, but it looks like they're being stored in php sessions as opposed to the db.
#5

[eluser]thody[/eluser]
Update: It's looking like something else in my app is conflicting somehow because it works fine with a fresh install of CI.




Theme © iAndrew 2016 - Forum software by © MyBB