title: How to generate unique session key to reference session in mysql table?
body: <p>I was using $_SESSION to store users IDs but I want to change to using a regular cookie (with a KEY) paired with SQL so I can keep users authenticated when they close their browsers.</p>
  
  <p>How do I create an unique key for each row in my SESSIONs table?</p>