Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6806565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:43:35+00:00 2026-05-26T19:43:35+00:00

i follow cakephp tutorial and when i log in to my account, link of

  • 0

i follow cakephp tutorial and when i log in to my account,
link of tutorial is :
http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application
, i can’t logout :
my code in logout method is

    function logout() {
    $this->Session->setFlash('Good-Bye');
    $this->redirect($this->Auth->logout());
}

and login code is :

    function login() {

    if ($this->Session->read('Auth.User')) {
        $this->Session->setFlash('You are logged in!');
        $this->redirect('/', null, false);
    }
}

this method is inside of users_controller .
but when i use this URL

http://localhost/newacl/users/logout

i comeback in

http://localhost/newacl/users

and i view this text

You are logged in!

therefore i can’t log out.
can you say what is happen and say what the work am i doing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:43:36+00:00Added an answer on May 26, 2026 at 7:43 pm

    Its problem of you redirect thing you logout ..Add below code in your App_controller.php beforeFilter

    $this->Auth->loginError = "Wrong credentials. Please provide a valid username and password.";
    
                $this->Auth->authError = "You don't have sufficient privilege to access this resource.";
    
                $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
    
                $this->Auth->logoutRedirect = array('controller' => 'users', 'action' => 'login');
    
                $this->Auth->loginRedirect = array('controller' => 'users', 'action' => 'home');
    

    In you r logout

     $this->Session->setFlash('You Succefully Logged Out');
             $this->Auth->logout(); 
             $this->redirect('/');  
    

    in your login try this

    if($this->Auth->user('id')){
         $this->Session->setFlash('You are logged in!');
          $this->redirect('/', null, false);
    }
    

    hope this may help you….

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey there, I'm using the tutorial at http://www.jamesfairhurst.co.uk/posts/view/uploading_files_and_images_with_cakephp to try to get myself up
Hi I'm trying to use the CakePHP comments plugin found here http://cakedc.com/downloads/view/cakephp_comments_plugin but the
I'm using CakePHP search plugin http://cakedc.com/downloads/view/cakephp_search_plugin and want to make an arg to search
I am new to cakephp and have been working through the Apress book Beginning
I'm pretty new to CakePHP and i'm running through both the Cake Book and
I have uploaded a working Cakephp web application to Mosso Cloud Sites hosting. The
I create a simple blog with cakephp where i have some posts and some
Follow this, it's really obvious and simple. For some reason, the results differ between
I have been looking for a tutorial to help me integrate PHPUnit with CakePHP.
I follow the wizard to create a http service to connect to a php

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.