开发者

User is not properly logged in Kohana with Auth module

开发者 https://www.devze.com 2023-03-28 15:51 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消