title: How to store Access token value in javascript cookie and pass that token to Header using AJAX call
body: <p>I have a login form, as shown below:</p>
  
  <pre><code>&lt;form method="post" name="logForm" onsubmit="onLogin()" action="dashbooard.html"&gt;
      &lt;label&gt;Email&lt;/label&gt;
      &lt;input type="text" name="email"&gt;
      &lt;label&gt;Password&lt;/label&gt;
      &lt;input type="password" name="pass"&gt;
      &lt;input type="submit" name="submit" value="Login" &gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Now when I click on the Login button, I am authenticated by the server and an <code>access_token</code> is generated and returned back to me via a REST API. </p>
  
  <p>I would like to store that <code>access_token</code> in a cookie and pass that token into a request. But, I don't know how to do this. I would love to receive help on this.</p>