title: Using cookies with axios and Vue
body: <p>I have created a Node.js express server that connects to Salesforce.com using the SOAP interface provided by 'jsforce'. It uses session cookies for authorization via the 'express-session' package.  So far, it has a POST method for login and a GET to perform a simple query. Testing with Postman has proven that this server is working as expected.</p>
  
  <p>As the browser interface to this server, I have wrttien a Vue application that uses axios to perform the GET and POST.  I need to save the session cookie created during login POST then attach attach the cookie to subsequent CRUD operations.</p>
  
  <p>I have tried various methods to handle the cookies. One method I have tried is using axios response interceptors on the POST</p>
  
  <pre><code>axios.interceptors.response.use(response =&gt; {
    update.update_from_cookies();
    return response;
  });
  </code></pre>
  
  <p>The function 'update_from_cookies' attempts to get the cookie named 'js-force' but it does not find it although I know it is being sent</p>
  
  <pre><code>import Cookie from 'js-cookie';
  import store from './store';
  
  export function update_from_cookies() {
    let logged_in = Cookie.get('js-force');
    console.log('cookie ' + logged_in);
    if (logged_in &amp;&amp; JSON.parse(logged_in)) {
      store.commit('logged_in', true);
    } else {
      store.commit('logged_in', false);
    }
  }
  </code></pre>
  
  <p>I have also seen various recommendations to add parameters to the axios calls but these also do not work.</p>
  
  <p>I would appreciate some advice about how to handle cookies using axios or some similar package that works with Vue</p>
  
  <p>Thanks</p>