title: Accessing universal-cookie set by React from NodeJS
body: <p>My ReactJS app creates an <code>httpOnly</code> universal-cookie with the token after the user logs in. The code is as follows,</p>
  
  <pre><code>cookies.set('token', res.data.token, { path: '/', httpOnly: true });
  </code></pre>
  
  <p>In my NodeJS backend code, I am trying to access this cookie by using the following code,</p>
  
  <pre><code>const cookies = req.universalCookies.get('token')
  </code></pre>
  
  <p>When I <code>console.log</code> the cookies variable it shows <code>undefined</code>.</p>
  
  <p>What am I doing wrong? How can I fix it? </p>
  
  <p>Is there any better and safe method that works? If yes then please let me know about that too.</p>