Welcome Guest, Not a member yet? Register   Sign In
Need help reducing database requests to check if a user is logged in
#5

[eluser]stef25[/eluser]
From the user guide: "The Session class does not utilize native PHP sessions" and I would avoid using $_SESSION - stick to the CI way.

Usually data is just stored in a cookie. There is an option (I didn't know of) that lets you also store it in on the server side in a db table. See "Saving Session Data to a Database" here: http://ellislab.com/codeigniter/user-gui...sions.html

I use the db_session extension from the wiki. Not sure what the difference is between this and the DB option of the native CI session class.

The main advantage of saving things on the DB side is that you are not limited by the 4KB max data you can store in a cookie.

The manual really explains it better than I could Smile

http://ellislab.com/codeigniter/user-gui...sions.html


Messages In This Thread
Need help reducing database requests to check if a user is logged in - by El Forum - 12-26-2009, 05:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB