title: How do you generate cryptographically secure random numbers with PHP?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1182584/secure-random-number-generation-in-php">Secure random number generation in PHP</a>  </p>
  </blockquote>
  
  
  
  <p>We need to generate a cryptographically random string to use as an authentication token, which will be tied to session data in the database.  We are using PHP, which doesn't appear to have a suitable random number generator built-in.  How can we generate a cryptographically secure random string of N length using php?</p>
  
  <p>Also note, due to the nature of our application, shell_exec is off the table.</p>