# XmlHttpRequest in an toggle button's panel will not send cookies

**URL:** <https://discourse.mozilla.org/t/xmlhttprequest-in-an-toggle-buttons-panel-will-not-send-cookies/13022>\
**Category:** Add-ons\
**Created:** [January 15, 2017, 4:34pm UTC](https://discourse.mozilla.org/t/xmlhttprequest-in-an-toggle-buttons-panel-will-not-send-cookies/13022 "2017-01-15T16:34:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![royp](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@royp](https://discourse.mozilla.org/u/royp)\
**Post date:** [January 15, 2017, 4:34pm UTC](https://discourse.mozilla.org/t/xmlhttprequest-in-an-toggle-buttons-panel-will-not-send-cookies/13022/1 "2017-01-15T16:34:07Z")

</div>

I have an addon that has a toggle button.  
When clicking on the toggle button I open a panel, which displays an HTML page.  
From that page I perform an XmlHttpRequest to our servers, the request is sent without any cookies.

I tried adding the following to the package.json file:

```auto
"permissions": {
        "cross-domain-content": ["MY_URL"]
    },

```

But that didn’t work.

Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![jorgev](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@jorgev](https://discourse.mozilla.org/u/jorgev)\
**Post date:** [January 17, 2017, 11:45pm UTC](https://discourse.mozilla.org/t/xmlhttprequest-in-an-toggle-buttons-panel-will-not-send-cookies/13022/2 "2017-01-17T23:45:13Z")

</div>

Do you see any errors in the console? Have you tried sending the request from the background script?
