While resetting password there is a need to prevent links to reopen again. For doing that you need an expiration check to validate whether link is in used state or not
So you need to store the current date time while sending the link to the user and by fetching it in query string where you want to use it
Then compare it with the current time and provide restrictions like link get expired after half an hour by finding the difference of current date and the query string date
string resetUrl = String.Format("{0}?id={1}&pswd={2}&exp={3}", "http://localhost:64343/PasswordReset.aspx", Encryption.Encrypt(Convert.ToString(person.id)), Encryption.Encrypt(person.password), Encryption.Encrypt(Convert.ToString(DateTime.Now)));
DateTime timestamp =Convert.ToDateTime(Request.QueryString["exp"]);
0 Comment(s)