I’m working on an application in ASP.NET 2.0, and i have given a task that passwords should not match with last three months c#.net.
For first three months passwords fields will b null i will store them in first three months but from 4th month what i have to do how will i store password in first field again after comparing password with all fields.Tell me some solutions my mind is totally stucked.
I’m working on an application in ASP.NET 2.0, and i have given a task
Share
I would say the best way to do this is to have a separate table consisting of the userID, password hash and timestamp. You would insert into here when a password is changed, timestamp would be of the current time on insert.
Then you can query this table when the user tries to change their password:
if the count > 0, they’ve used it within the last 3 months. If not, insert it into this table and change the main user table record as well.
You would probably also want to clean up this table periodically.
would delete anything older than 3 months, since we don’t really need it anymore.