Online Forum To Support Coders With Technical Assistance - Read Write Execute

How to check whether user logged in or not

Ankit Agrawal
Ankit Agrawal
Published on March 21, 2018 · 1 min read

Cakephp 3.x

if($this->request->Session()->read('Auth.User'))
{
	//user is logged in 
}
else
{
	//user not logged in 
}

Cakephp 2.x

if($this->Session->read('Auth.User'))
{
	//user is logged in 
}
else
{
	//user not logged in 
}
Was this article helpful?
Ankit Agrawal

Ankit Agrawal

Author & Senior Engineer at CodeExecute

Writing practical engineering guides, debugging real-world bottlenecks, and creating free tools for developer productivity.

← Previous Article What is composer Next Article → What is seo