1

I have to set count down day for the password field in a table user to renew again by user.

If not renewed he should not be able to login.

This should be done in SQL user table, and should be done every time after a 30 day expiry period.

So please help me in this....

Adam Starrh
  • 6,428
  • 8
  • 50
  • 89
Roy shetty
  • 33
  • 4
  • Store the date of last password change date in the db and after every password validation during login, check if current date is equal to last password change date + 30 days. If yes display password reset screen to the user. On successful password change change the past password change date to current date. Don't login the user until user change the password. – Chetan May 27 '17 at 19:53
  • This will not be only database change . Your application also need to have some code. – Chetan May 27 '17 at 19:54
  • Don't attempt to use a counter. Use a password expiry date that is set when the password is changed. Check whether the current date is more recent than the expiry date — if it is, deny login access. – Jonathan Leffler May 27 '17 at 21:29

1 Answers1

2

Store the password created date in user records table.

Set up a job that runs every day to query from this the table and retrieve the records where currentdate-passwordcreateddate > 30.

Set up job to send out notification to users in this result set.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
RKRC
  • 119
  • 1
  • 4