Welcome Guest, Not a member yet? Register   Sign In
Store native session in database?
#1

[eluser]Unknown[/eluser]
Hi all,

I've been developing with Codeigniter for a few years now. I started using a native session library, because the codeigniter session library often failed in school environments.
I still have the session stored in a database. But is this really necessary? We use one dedicated server for one single domain. Are there any benefits in using database storage in addition to the default session storage?

Thanks
#2

[eluser]InsiteFX[/eluser]
If you do not use database sessions then it will default to using cookies which can only hold 4kb od data.
#3

[eluser]Unknown[/eluser]
I use native sessions, so the only thing stored in the cookie is a sessionid, nothing else.
#4

[eluser]bikuta[/eluser]
I'm using the native session library as well, and I thought it had been saving to the database, but when I checked just now, the session table is completely empty.

I already have these settings:
$config['sess_use_database'] = TRUE;
$config['sess_table_name'] = '_sessions';

and I've created my table called "_sessions".

What else do I need to do to make it store the data in the database?
#5

[eluser]InsiteFX[/eluser]
Native Sessions do not save to the database.
#6

[eluser]bikuta[/eluser]
That's what I thought, since it doesn't even look at that config setting.

Any ideas on what would be the easiest way to get it to save to the DB just like the CI Session library?
I tried to see how the CI Session library does it and all I can see is this line:
$this->CI->load->database();

Could someone point me to where it actually runs the queries to write to the database?




Theme © iAndrew 2016 - Forum software by © MyBB