title: Difference between creating a session and a cookie?
body: <p>I'm working on my first website with the Play! framework, and at one point I'm calling this method when the user logs in:</p>
  
  <pre><code>static void connect(User user){
      session.put("userid", user.id);
  }
  </code></pre>
  
  <p>Simply storing the userid in a session, and I can check if it's set on each request, works fine. Problem is, once the browser is closed the cookie is lost, and the user needs to login again. I want to create a "remember me" option, and it seems that the only way to do that is create a cookie and send it with the respons, like this:</p>
  
  <pre><code>response.setCookie("user", userdata, "14d");
  </code></pre>
  
  <p>So I'm wondering, what's the point in creating a session, when it does the exact same thing? (But does not give me any control over the cookie time). And another thing I havn't found yet, is how to read the cookie from the request?</p>
  
  <p>(And I'm aware of the fact that cookies created with setCookie are not encrypted and I need to call <code>Crypto.sign()</code>)</p>