문제

I have used Auth component in my cakephp site. I want to check whether auth session is there or not from controller.

Please help.

도움이 되었습니까?

해결책

You can access Auth component by $this->Auth from the controller.

$this->Auth->user() will give you the currently authenticated user. The information is taken from the session. If this method returns null, the user is not logged in.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top