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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:30:40+00:00 2026-05-25T20:30:40+00:00

I have forgot password feature in my cakephp application. The function for this will

  • 0

I have forgot password feature in my cakephp application. The function for this will request the email address, find this user, generate a new password, convert it to sha1 and save it to the database, emailing the contents to the user.

Anyway I am having issues, the generated sha1 password is different to the one being saved.

I have called the info to the screen to show what is happening:

TEMP PASSWORD– lHQcVp4 (FROM THE FUNCTION)
Blockquote

SHA1 PASSWORD– 0ee4ae757733f458b9e395a8457c2ef307af99f0 (FROM sha1($user[‘User’][‘tmp_password’]);

Auth Password PASSWORD– 93df9bd251620d0634235c22f4ab6fe9ad5421f4 (FROM: $this->Auth->password($user[‘User’][‘tmp_password’]);)

DB Record After Save PASSWORD– 13ef648db45cc62b593c3943646806af06846016 (FROM $this->User->field(‘password’);)

I am saving the data as follows: $this->User->save($user, false)

Why would it come though differently all 3 times? I cannot work it out. Very strange.

Thankyou

  • 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-25T20:30:40+00:00Added an answer on May 25, 2026 at 8:30 pm
    sha1($user['User']['tmp_password'] 
    

    This will simply hash the password and output the text

    $this->Auth->password($user['User']['tmp_password']);
    

    This hashes the password with the cakephp salt defined in core.php. This is why you see a difference

    If you simply set the password value to $user[‘User’][‘password’] and call save() on it, Auth might be hashing the password again since it doesn’t know you’ve already hashed it. Have you tried just setting the password to $user[‘User’][‘password’] and calling save() on it? Let Auth handle the hashing for you.

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

Sidebar

Related Questions

I am building a service that will have a 'forgot my password' feature. In
I have a form with three fields Name, Email Address & Password. now i
in my forgot password page user enters email id and clicks on submit button,the
I have a 'forgot password' system set up that sends an email with a
I have to give user an email which will contain a link . After
I have a forgot password page in which i need to ask from the
n the login section I have a username, password textbox, submit button and forgot
I'm having a few problems with the forgot password system from this tutorial .
I am looking to implement a Forgot Password feature on my website. I like
Hello! I have problem with connecting to remote host. I forgot ssh password but

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.