I have used Auth component in my cakephp site. I want to check whether au开发者_运维问答th 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.
精彩评论