title: How to get `csrftoken` in Vue.js?
body: <p>In Vue.js project, how can I get the <code>csrftoken</code>? </p>
  
  <p>I tried use <code>js-cookie</code>, but can not get it:</p>
  
  <pre><code>import Cookies from 'js-cookie';
  
  if (Cookies.get('csrftoken')!==undefined) {   // there will skip, because the Cookies.get('csrftoken') is undefined.
  
    config.headers['x-csrftoken']= Cookies.get('csrftoken');  // 'CSRFToken '
  
  }
  </code></pre>
  
  <p>but I can get other cookie.</p>
  
  <hr>
  
  <p><strong>EDIT</strong></p>
  
  <pre><code>Cookies.get('csrftoken')
  </code></pre>
  
  <p>this code get <code>undefined</code>. </p>
  
  <p>But when I access, there is the <code>csrftoken</code>.</p>
  
  <p><a href="https://i.stack.imgur.com/0GUAr.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0GUAr.jpg" alt="enter image description here"></a></p>