User is not properly logged in Kohana with Auth module
I'm using the Auth module for managing users inside Kohana.
When I use the login($username, $password, $remember) method it succeeds validating the user but then when I ask if the users is logged in (logged_in() method) it returns false.
What开发者_JS百科 am I missing here?
Thanks in advance.
The only thing logged_in does for the default Auth driver is check if there is an active session with a proper key that points to a logged in user.
Your question is too global to be able to give a direct answer, but it might be that the problem stems from improper Cookie settings. Your session will always be saved in a Cookie and if the cookie path and/or domain are not properly setup, then the session will be invalid and Auth::instance()->logged_in() will return false.
Check this link for setting up cookies in Kohana: http://kohanaframework.org/3.2/guide/kohana/cookies
精彩评论