title: Nuxt.js - get cookie inside plugin
body: <p>I had a Vue.JS application and use axios as a HTTP client by just importing its instance into the components (like this): </p>
  
  <pre><code>import axios from 'axios'
  import cookies from '~/components/cookies.js';
  var api = axios.create({
    baseURL: 'http://localhost.api/',
    timeout: 10000,
    headers: {
    'Authorization': cookies.get('token',''),
    'X-Refresh-Token': cookies.get('refreshtoken'),
    'Content-Type': 'application/json'
  }
  })
  
  export default api;
  </code></pre>
  
  <p>...</p>
  
  <pre><code>import api from '~components/api.js'
  </code></pre>
  
  <p>Cookies were obtained from document.cookie.
  But now I moved to Nuxt and document is not defined during server rendering. So, how can I get cookies from the server request? (or even dynamically change token in the process)</p>