CodeIgniter Forums
Possible to only store some data in the Sessions table? (about 1.7.0 change) - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Possible to only store some data in the Sessions table? (about 1.7.0 change) (/showthread.php?tid=12819)



Possible to only store some data in the Sessions table? (about 1.7.0 change) - El Forum - 11-01-2008

[eluser]inktri[/eluser]
I maintain some data that is non critical in the session cookie and I have to access to access it a lot. Therefore I want to keep some stuff solely in the session cookie so my script doesn't make so many DB calls. Is that possible? or should I just create another cookie for the non critical data?


Possible to only store some data in the Sessions table? (about 1.7.0 change) - El Forum - 11-01-2008

[eluser]meade[/eluser]
I would suggest creating a denormalized table to maintain user specific/session specific data instead of using cookies to store data. I'm no cookie expert, but I would imagine the time to read/transmit a cookie (if stored on the client) is not much different then a well formed table. There's also some size limits on cookies, time expiration, etc.


Possible to only store some data in the Sessions table? (about 1.7.0 change) - El Forum - 11-01-2008

[eluser]inktri[/eluser]
Can someone shed some light as to how the Sessions table works?

I've autoloaded the Session class. For every refresh, does MySQL do a SELECT WHERE id=id on the Sessions table? Or does that only happen when I call get userdata() in my PHP page?