Hello Readers! While creating an application what we notice is when user log in to the application using the credentials and while being logged in if user clicks on the browser back button he/she is redirected to the login page again. Same is the case when user log out of the application and clicks on the back button he/she is redirected to their welcome page which is not authenticate.
What we want is to stop user to go back to previous page after logging in and logging out of the application.
Just add few lines of code to your AppController.php file:
public function beforeRender() {
$this->response->disableCache();
}
And the problem is solved :)
0 Comment(s)