title: Instant login from email. Why have so few done this?
body: <p><em>Tried searching for this but turned up nothing.  Discussion or relevant links are requested.</em></p>
  
  <p>Suppose we are going to send an email to entice a user to login to our super social webapp.  The goal of this email is to get them to return to the site and poke around a bit more before they forget us so naturally we want to lower the barrier to them returning.  Cookies help in preventing them from needing to log in every time but still don't help in the case when the user has forgotten their credentials.  We want instant gratification here--one click straight to the action baby.  Instead, why can't we just send the user a hashed form of a randomly generated, time-sensitive token that we have stored in the DB?  If they can supply this token back to the server then we can we trust their identity.</p>
  
  <p>This scenario seems like it could be secure, as long as you managed the tokens correctly.  The process would be something as follows:</p>
  
  <ol>
  <li><p>Before sending the reminder email to John Doe, generate a random number token (a large enough number to prevent guessing) that expires after a few days.</p></li>
  <li><p>In the email, include a url that contains a hashed form of the token (perhap xor with the user's ID).</p></li>
  <li><p>When John Doe logs into his email and clicks on the link, the server verifies the existence of the token in the DB and that it isn't expired.  If the token exists, he is automatically logged in by the server.</p></li>
  </ol>
  
  <p>Security:  We assume that the email for John Doe actually belongs to John Doe, if only because email addresses are verified as part of the registration process.  Any user that has access to John Doe's email would be able to access his account; however, this isn't new.  Many sites already assume that the user's email account is secure because they implement the feature to reset password to email.</p>
  
  <p>My googling has turned up only one site that does this, OKCupid, which is an online dating site.   Does anyone know of any other sites that do this?  Why isn't instant login via email more common?  Security?  Lack of substantial benefit for the added complexity?  </p>