views:

22

answers:

1

Hi there,

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

Please help.

+2  A: 

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.

bancer
Thankx bancer. It worked.
lakum4stackof
You're welcome.
bancer