Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Disable back button after login and logout.

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 643
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: