title: Using cookies to auto-login a user in asp.net (custom login)
body: <p>i can't find on the net what i'm looking for so any help would be appreciated.
  I have implemented a <strong>custom login</strong> form where the user enters his email and password to log in. I then query the database with those credentials (password is hashed and salted) and if both are found then i store the UserID in the Session state. If the user closes the browser then the Session is lost so he would have to log in again. 
  I learned about using cookies to implement the "Remember me" functionality but i don't know what should i be storing in the cookie for the auto-login process and to make it secure.</p>
  
  <p>PS: I know what a cookie is and how it works. I also know that storing the user credentials (email + password) in a cookie is NOT advised. <strong>I'm using asp.net 4.0 with C#</strong></p>
  
  <p>Actually i'm looking for the logic behind the auto-login system using cookies.</p>
  
  <p>Thanks!</p>