Retrieving 'user_data' in Session Database |
[eluser]jova[/eluser]
How do you retrieve and make sense of user_data array from the CI_SESSION table? a:3:{s:10:"user_email";s:23:"[email protected]";s:7:"user_id";s:1:"1";s:1:"l";s:1:"1";}
[eluser]jova[/eluser]
I know i can get it to print, but how do I take it apart and actually make use of the data.
[eluser]jova[/eluser]
I can't really do much with a:3:{s:10:“user_email”;s:23:“[email protected]”;s:7:“user_id”;s:1:“1”;s:1:“l”;s:1:“1”;} How do I take whatever data is in the session database's 'user_data' column and actually use it. (i.e. How do I say something like if the user's session matches the database session id, check to see if the cookie and database email matches)
[eluser]Colin Williams[/eluser]
http://us3.php.net/unserialize But, you should really just use the Session class functions, like $this->session->userdata('email'); The Session class handles the validation you talked about for you (matching the session IDs) |
Welcome Guest, Not a member yet? Register Sign In |