CodeIgniter Forums
Database session table - IDs - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19)
+--- Thread: Database session table - IDs (/showthread.php?tid=67660)



Database session table - IDs - fmertins - 03-21-2017

Hi folks, I'm using CI 3.0.6 with database session. I got these records:

[Image: print.png]

I'm wondering here... Why having 3 records with the same IP and timestamp, but different IDs? Also, different data sizes...

* * *

Here is my session config:

Code:
$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'cisession';
$config['sess_expiration'] = 3600;
$config['sess_save_path'] = 'sessao';
$config['sess_match_ip'] = TRUE;
$config['sess_time_to_update'] = 300;

Thank you.


RE: Database session table - IDs - Narf - 03-21-2017

Too broad to just guess.

I can tell you one thing that you're doing wrong for sure though - running 3.0.6 while the latest version is 3.1.4.

Also, 1MB of session data?!


RE: Database session table - IDs - fmertins - 03-22-2017

(03-21-2017, 03:09 PM)Narf Wrote: Also, 1MB of session data?!

Hi there, new day, fresh head... :-)

I was doing this:

Code:
$this->CI->session->set_userdata('paginacao', $this);

In a class constructor and having a property holding the Super Object CI... I'm afraid this was the cause for high data volume. I've just refactored to a local variable and things got OK again.

Just for curiosity: blob session field with super object CI: ~400 KB, then refactored without it: less then 1 KB :-D

Lesson: do not store the CI object at database session! I was doing this without notice.

Thank you!