title: How to get HTTP-only cookie in React?
body: <p>I'm currently developing a MERN stack application and the authentication I use is JWT and saving it in my cookie. This is how I send the cookie after the user login.</p>
  <pre><code>              res
                  .cookie(&quot;token&quot;, token, {
                    httpOnly: true,
                    secure: true,
                    sameSite: &quot;none&quot;,
                  })
                  .send();
  </code></pre>
  <p>And I am logging in the user by getting the &quot;token&quot; cookie in my backend. However, I implemented Redux with this application and every time I refresh the page, it automatically logs out. What I want is to detect in my front-end(React) the &quot;token&quot; cookie in my browser and I can't get it. I've tried using npm js-cookie and still can't get it. Is there a way to get the &quot;token&quot; cookie? Or use redux-persist based on what I've read? Please help, thanks.</p>