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

  • Home
  • SEARCH
  • 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 7807989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:01:20+00:00 2026-06-02T03:01:20+00:00

I am using CakePHP to create a simple app and I decided to use

  • 0

I am using CakePHP to create a simple app and I decided to use Digest Authenticate since I can’t get an SSL certificate and don’t want passwords posted in plain-text by a form.

So it’s all working nicely, login, logout, everything works according to login status. However after logging out when I go to login again it logs in automatically without asking for a password or username. This makes it impossible to change accounts until I’ve been logged out for some period of time(a day or so?) and it asks for a username and password again. It also is a security risk if I am using a public computer and don’t want the next guy logging into my account all willy nilly without even a password prompt.

My question, is there a setting in Cake that I am missing or is this my browser remembering my credentials and offering them up when the app asks for them. I feel like logging out should clear the credentials. I have tried in Chrome and Firefox both with the same result, I am not checking any “remember my password” boxes either.

My Auth component intiation:

public $components = array('Session', 'RequestHandler', 'Auth' => array(
            'authenticate' => array('Digest'),
            'loginRedirect' => array('controller' => 'posts', 'action' => 'index'),
            'logoutRedirect' => array('controller' => 'posts', 'action' => 'index'),
        ));

Login Function:

public function login() {
//No longer Auth Magic
 if ($this->Auth->login()) {
   return $this->redirect(array('controller' => 'posts', 'action' => 'index'));
 } else {
   $this->Session->setFlash(__('Username or password is incorrect'), 'default', array(), 'auth');
 }
   $this->autoRender = false;
}

Logout Function:

public function logout() {
   $this->Auth->logout();
   return $this->redirect($this->Auth->logout());

}

So any ideas? The only other thing I should mention is that I had to include DigestAuthenticate.php manually in order to use use the DigestAuthenticate::password function, Cake was throwing some errors saying that the DigestAuthenticate class didn’t exist. See the issue here: http://ask.cakephp.org/questions/view/digestauthenticate

  • 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-06-02T03:01:22+00:00Added an answer on June 2, 2026 at 3:01 am

    According to the CakePHP Book [here]:

    Logging out users that logged in with Digest or Basic auth is
    difficult to accomplish for all clients. Most browsers will retain
    credentials for the duration they are still open. Some clients can be
    forced to logout by sending a 401 status code. Changing the
    authentication realm is another solution that works for some clients.

    That’s probably not what you wanted to hear, but…

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

Sidebar

Related Questions

I am using cakephp 1.26 to create a simple message board in my localhost.
Hi I'm looking to create a simple Forgot Password system using CakePHP where a
I am using CakePHP to create a simple blog for myself. I want to
I am working on a CMS using CakePHP and I want to create a
i am trying to create a Radio button using Cakephp like the one the
I'm trying to create an XML sitemap using CakePHP, from a table which has
I'm new to cakePHP.I just tried to create a simple form with a text
Using cakephp: I create a website & after upload my site to main server
I'm trying to create a form using Cakephp's FormHelper class. The form needs to
I am using CakePHP to write a web app and one of the requirements

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.