title: How to set cookie in React Native with Expo?
body: <p>I am having a hard time getting cookies to work, on the server side I use them to verify the user by grabbing them from req.cookies.</p>
  
  <p>Here is how I currently set it on the Login.js file in React Native:</p>
  
  <pre><code>import Cookies from "universal-cookie";
  
  const cookies = new Cookies();
   cookies.set("token", token, {
                  expires: 7, // 7 days
                  path: "/"
                  //,secure: true // If served over HTTPS
     });
  </code></pre>
  
  <p>This works fine when I call a <code>cookies.get("token")</code> on this page. However, when I import, setup the const, and call get on another page the token does not show up... </p>
  
  <p>Also, when I make the fetch like this: </p>
  
  <pre><code>fetch("http://192.168.0.115:3000/myTransactions/", {
        credentials: "same-origin",
        method: "POST",
        headers: {
          Accept: "application/json",
          "Content-Type": "application/json"
        }
      })
  </code></pre>
  
  <p>The server does not receive any cookies. I even changed credentials to say include.</p>
  
  <p>I am using expo and my terminal on Windows to run it without having to use android studio or xcode. I am not sure if that is a possible issue.</p>
  
  <p>Any thoughts! </p>
  
  <p>Thanks</p>