Friday, September 28, 2012

Use session in model

CakePHP way:

 App::import(‘Component’, ‘SessionComponent’);  
 $session = new SessionComponent();  
 $auth = $session->read("Auth.user");  

Normal PHP way:
 $auth=$_SESSION['Auth']['user'];  

No comments:

Post a Comment