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 6348131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:21:47+00:00 2026-05-24T21:21:47+00:00

How can I make a user have to re-enter their password when they access

  • 0

How can I make a user have to re-enter their password when they access their account? So for example: domain.com/account and then they see a simple password field (even though they are logged in) if they get the password wrong then they are logged out and sent to the home page with a session message saying ‘for security reasons you have been logged out of your account’.

Can anyone help?

The account is the edit method in my users controller.

Thanks

  • 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-24T21:21:49+00:00Added an answer on May 24, 2026 at 9:21 pm

    I’d do something like this ~

    // edit.ctp View
    echo $this->Form->input('password_check', array('type'=>'password'));
    
    // user.php Model
    function check_user_password($get_the_current_users_id) { 
        $salt = Configure::read('Security.salt');
        $this->User->id = $get_the_current_users_id;
        $hashed_password = $this->User->field('password');
        // check password  
        if($hashed_password == md5($data['User']['password_check'].$salt)) {  
            return true;
        } else {
            return false;
        }
    }  
    

    You’d need to adjust the password hashing bit; if you don’t use the salt etc.

    But the idea is to compare the users hashed password in the database, to the one they submit. If it matches; then you can proceed. Else, you can logout/return an error. (For usability I would not log out a user as that would just be annoying.)

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

Sidebar

Related Questions

Well i need to make it so any user can have a foo.com/username in
I have a setup view where the user can enter their name and email
I have a small app, where user can make some calculations and solve equations.
I have a RichTextBox, when users type their text, quite often they enter links
Now that I can make useful user controls in WPF (thanks to this stackoverflow
i wonder how you can make an advanced Android User interface where you can
I need to make sure that user can run only one instance of my
I want to make a site where there user can basically navigate the web
I am trying to make a map where a user can outline any shape
I am trying to make it so that a user can ctrl-click outside of

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.