Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Use of TimeStamp while reset password

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 364
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: