Welcome Guest, Not a member yet? Register   Sign In
Session Guidance
#1

[eluser]TerryT[/eluser]
New to CI and have a couple of questions on sessions. I have read the User Guide and searched the forums prior to posting, but haven't been able to figure it out.

I am storing sessions in a database. That is working fine. What code do I need to put in my Controllers to validate the session cookie against the database?

2. How do I read the userdata column in the session table? Here's some output:

a:6:{s:5:"email";s:15:"admin@admin.com";s:2:"id";s:1:"1";s:7:"user_id";s:1:"1";s:8:"group_id";s:1:"1";s:5:"group";s:5:"admin";s:17:"flash:new:message";s:29:"<p>Logged In Successfully</p>";}

What does the a:6: mean? 6 attributes?

Terry
#2

[eluser]WanWizard[/eluser]
You don't have to, the session library will do that for you when you load it, and present you with the correct session information.
No need to interfere with the library's internals. You don't need to use the session table, you use the methods of the session library.

Check the user guide for the available methods and how to use them.




Theme © iAndrew 2016 - Forum software by © MyBB