Can't assign object to session variable?
I am having trouble understanding why the followin开发者_开发知识库g statement doesn't work?
$_SESSION['user_level'] = $member_info->user_level;
When I dump the session back, I only see array([user_level] => )
so it is clearly missing the value?
I've tested the object by doing print_r($member_info->user_level);
and it indeed returns the correct value so I know that is not the problem.
So I am stumped...Thanks...
This problem has been solved by using var_dump() instead of print_r().
Here's a comparison between var_dump, print_r and var_export:
http://forum.kohanaframework.org/discussion/1631/var_dump-print_r-var_export/p1#Discussion_1631
精彩评论