I want to add functionality to check session ao. I created one function like checkSession in my app_controller. Now, the first time the application loads it redirects to the admin/users/login
page.
At this login form, if I insert correct data then it redirects to my applications home page. I have user admin prefixed in my application.so after successfull login I want to redirect to localhost/appName/admin so I wrote the below code:
$this->redirect(Router::url("/admin",true));
It works fine in local but when I upload it on server it shows me error like
Warning (2): Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/pms/app/controllers/users_controller.php:192)
The code on 192 line is
$this->redirect(Router::url("/admin",true));
Can you suggest me its alternative option?