title: Access Token vs Refresh Token NodeJS
body: <p>I'm new to <code>JWT</code> which stands for <code>Json Web Token</code>. I've confused with couple of its terms: Access Token and Refresh Token. </p>
  
  <p><strong>purpose:</strong> I wanna implement a user authorization which logs the user out  after two hours of being idle (don't request the site or exit from the browser).</p>
  
  <p>To reach that goal I'm trying to follow the below items:</p>
  
  <ol>
  <li>After the user registers/logs-in in the site, I create <code>Access Token</code> and <code>Refresh Token</code>.</li>
  <li>Save the refresh token in the DB or cookie.</li>
  <li>After 15 minutes the users token the access token expired.</li>
  <li>In case of a user being idle for 2 hours, I remove the refresh token from the cookie or DB, else I renew the access token using refresh token.</li>
  </ol>
  
  <p>Is there any optimized way to reach that purpose? </p>