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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:06:14+00:00 2026-06-12T00:06:14+00:00

I want to have a user management system. I allow users to change their

  • 0

I want to have a user management system. I allow users to change their password, but I should have restrictions. For instance that the new password is not any of the last five passwords used.

How should I maintain a list of the last five passwords?

  • 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-12T00:06:15+00:00Added an answer on June 12, 2026 at 12:06 am

    I already posted a comment above. But just to answer your question. You should create an old_passwords table with the user_id, old_password, creation_date in it.

    Store the date when the password is first created in the main table. When changing the password copy the old password and that original date to creation_date in the old_passwords table. Then update the password, and set the date to now in the main user table.

    You should also probably drop a unique index on user_id, creation_date.

    To delete:

    DELETE FROM old_password
    WHERE user_id = ## AND creation_date NOT IN
      (SELECT creation_date
       FROM old_password
       WHERE user_id = ##
       ORDER BY creation_date DESC
       LIMIT 5)
    

    (You should test this code BTW.) You run this query when a person updates their password.

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

Sidebar

Related Questions

I have a Drupal site where I want to allow users to add their
I want to have a delete user link in a normal Activerecord table, but
I have some user-submitted variables that I want to display in a different part
I'm developing an add on to a system I have that will allow my
I have implemented product management system.I want to add one new features in which
I have some project management system. If I want to open project with id=123
We want to develop a purchase system for countries that have no access to
I want to use System.Management.ManagementScope to query the list of currently logged in users.
I have developed a Attendance management system, i want to generate report by running
I am developing a training management web-based system that provides the user with short

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.