title: best practice to generate random token for forgot password
body: <p>I want to generate identifier for forgot password . I read i can do it by using timestamp with   mt_rand(), but some people are saying that time stamp might not be unique every time. So i am bit of confused here. Can i do it with using time stamp with this ?</p>
  
  <p><strong>Question</strong><br>
  What's best practice to generate random/unique tokens of custom length?</p>
  
  <p>I know there are lot of questions asked around here but i am getting more confused after reading different opinion from the different people. </p>