title: Where to store JWT
body: <p>I barely started reading about JWT and I beliave I understand what a JWT token is. I am also fairly familiar with SESSIONS. And I believe I understand the pros of each as well as their cons. However, there are a couple of parts where I am confused. </p>
  
  <p>When requesting a protected resource, you need to send the jwt on each request, as opposed to having a session stored on the server. But:</p>
  
  <p>1) how do you store your JWT token and where. From what I read I understood that you send your request to authenticate to the server and the server sends you a JWT token if you are successfully authenticated. Then what do you do?, do you store the JWT in a cookie as I have read in some sites? If so, how do you do it (using php, using javascript). And how do you read it.</p>
  
  <p>2) When using session, more or less you just check that there is a session to check the user is logged in. How do you accomplish this when using JWT.</p>
  
  <p>Also I have seen this on some pages:</p>
  
  <pre><code>RewriteCond %{HTTP:Authorization} ^(.*)
  RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
  </code></pre>
  
  <p>How is this related to this (if related at all)</p>