title: Can a browser extension read a website's cookie?
body: <p>I am creating cookies like below. I know that <a href="https://stackoverflow.com/a/12370586/654789">website A can't read a cookie from website B</a>, but I was wondering if a plugin could do so? I have a browser extension/plugin which has a minimalist interface and provides for login capabilities, but it has a <em>go to dashboard</em> link and I don't want to make the user login again. Then they would have to log out again. If this is not possible, what other options do I have</p>
  <pre><code>function create_cookie(name, value, days) {
      var expires;
  
      if (days) {
          var date = new Date();
          date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
          expires = &quot;; expires=&quot; + date.toGMTString();
      } else {
          expires = &quot;&quot;;
      }
      document.cookie = encodeURIComponent(name) + &quot;=&quot; + encodeURIComponent(value) + expires + &quot;; path=/&quot;;
  }
  </code></pre>