Welcome Guest, Not a member yet? Register   Sign In
Using PHP Session and the CI Session together
#18

[eluser]WanWizard[/eluser]
It all depends on your environment.

In general, a database engine is a lot more efficient in I/O than PHP's native file I/O code (unless it's very badly configured or overloaded (which happens a lot in a shared environment)). Database sessions give you added benefits as well, such as a list of all logged in (or active) users (within a given time frame).

However, there is always a point where it becomes wise to enable caching, switch from database to file, switch from file to memory, etc. I find it generally very difficult to give 'general' advice about when you should do what. As suggestions, I fully agree with your reply.

Note that the CI session library could need some improvements. Currently, every time you call set_userdata(), it updates the session record. I've extended the session library so it only does two I/O's: one read when the session library loads (and an insert when the session doesn't exist), and one update at the end of every page request. You also have to force a write when you do a redirect, otherwise you lose the variables set before the redirect.


Messages In This Thread
Using PHP Session and the CI Session together - by El Forum - 08-24-2010, 03:15 AM
Using PHP Session and the CI Session together - by El Forum - 08-24-2010, 05:19 AM
Using PHP Session and the CI Session together - by El Forum - 08-24-2010, 05:32 AM
Using PHP Session and the CI Session together - by El Forum - 08-24-2010, 05:37 AM
Using PHP Session and the CI Session together - by El Forum - 08-24-2010, 05:50 AM
Using PHP Session and the CI Session together - by El Forum - 08-24-2010, 06:49 AM
Using PHP Session and the CI Session together - by El Forum - 08-24-2010, 07:19 AM
Using PHP Session and the CI Session together - by El Forum - 08-24-2010, 01:44 PM
Using PHP Session and the CI Session together - by El Forum - 08-24-2010, 01:51 PM
Using PHP Session and the CI Session together - by El Forum - 08-24-2010, 01:54 PM
Using PHP Session and the CI Session together - by El Forum - 08-24-2010, 02:16 PM
Using PHP Session and the CI Session together - by El Forum - 08-24-2010, 02:28 PM
Using PHP Session and the CI Session together - by El Forum - 08-24-2010, 02:47 PM
Using PHP Session and the CI Session together - by El Forum - 08-25-2010, 03:08 AM
Using PHP Session and the CI Session together - by El Forum - 08-25-2010, 09:42 AM
Using PHP Session and the CI Session together - by El Forum - 08-25-2010, 12:34 PM
Using PHP Session and the CI Session together - by El Forum - 08-25-2010, 12:52 PM
Using PHP Session and the CI Session together - by El Forum - 08-25-2010, 01:06 PM



Theme © iAndrew 2016 - Forum software by © MyBB