# Ember App does not send sessionId back to server

**URL:** <https://discuss.emberjs.com/t/ember-app-does-not-send-sessionid-back-to-server/21391>\
**Category:** Uncategorized\
**Created:** [December 4, 2024, 1:22pm UTC](https://discuss.emberjs.com/t/ember-app-does-not-send-sessionid-back-to-server/21391 "2024-12-04T13:22:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marco\_Musolf](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/marco_musolf/32/17400_2.png) [@Marco\_Musolf](https://discuss.emberjs.com/u/Marco_Musolf)\
**Post date:** [December 4, 2024, 1:22pm UTC](https://discuss.emberjs.com/t/ember-app-does-not-send-sessionid-back-to-server/21391/1 "2024-12-04T13:22:29Z")

</div>

I have an Ember app which retrieves data from an express App via Rest-Calls. After a successfull Login the Server creates a Session an put some data into it. On each subsequent Rest call of the Ember App the Session on the Server is newley created. When I execute the same Request by using Postman everythin works fine and the session remains the same.

Any idea on how to solve this issue ?

---

<div class="post-metadata">

**Author:** ![tehhowch](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/tehhowch/32/17480_2.png) [@tehhowch](https://discuss.emberjs.com/u/tehhowch)\
**Post date:** [December 6, 2024, 4:32pm UTC](https://discuss.emberjs.com/t/ember-app-does-not-send-sessionid-back-to-server/21391/2 "2024-12-06T16:32:17Z")

</div>

Have you configured your fetch requests to include credentials? If not, this sounds like expected behavior as the browser will not include cookies.

---

<div class="post-metadata">

**Author:** ![dknutsen](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/dknutsen/32/16471_2.png) [@dknutsen](https://discuss.emberjs.com/u/dknutsen)\
**Post date:** [December 6, 2024, 4:42pm UTC](https://discuss.emberjs.com/t/ember-app-does-not-send-sessionid-back-to-server/21391/3 "2024-12-06T16:42:02Z")

</div>

Are you using an authentication library like [ember-simple-auth](https://github.com/mainmatter/ember-simple-auth)? If not I would consider setting up ESA, otherwise you’ll be hand-rolling some of the functionality.

---

<div class="post-metadata">

**Author:** ![Marco\_Musolf](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/marco_musolf/32/17400_2.png) [@Marco\_Musolf](https://discuss.emberjs.com/u/Marco_Musolf)\
**Post date:** [December 6, 2024, 8:06pm UTC](https://discuss.emberjs.com/t/ember-app-does-not-send-sessionid-back-to-server/21391/4 "2024-12-06T20:06:50Z")

</div>

Yes I am using ember-simple-auth

---

<div class="post-metadata">

**Author:** ![Marco\_Musolf](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/marco_musolf/32/17400_2.png) [@Marco\_Musolf](https://discuss.emberjs.com/u/Marco_Musolf)\
**Post date:** [December 6, 2024, 8:07pm UTC](https://discuss.emberjs.com/t/ember-app-does-not-send-sessionid-back-to-server/21391/5 "2024-12-06T20:07:21Z")

</div>

How can I configure Emser in Order to set this property ?

---

<div class="post-metadata">

**Author:** ![real\_ate](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/real_ate/32/14480_2.png) [@real\_ate](https://discuss.emberjs.com/u/real_ate)\
**Post date:** [December 13, 2024, 10:39am UTC](https://discuss.emberjs.com/t/ember-app-does-not-send-sessionid-back-to-server/21391/6 "2024-12-13T10:39:39Z")

</div>

So there are some specifics that we would need to know to be able to help you. It’s great that you’re using ember-simple-auth, that’s quite useful for having a session available with your auth credentials wherever you are making requests but we need to make sure that you are sending your credentials with every request.

How do do you actually do your REST calls? are you using ember-data? are you using fetch? do you have a service that you use that handles your fetch calls for you?

---

<div class="post-metadata">

**Author:** ![Marco\_Musolf](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/marco_musolf/32/17400_2.png) [@Marco\_Musolf](https://discuss.emberjs.com/u/Marco_Musolf)\
**Post date:** [December 16, 2024, 11:40am UTC](https://discuss.emberjs.com/t/ember-app-does-not-send-sessionid-back-to-server/21391/7 "2024-12-16T11:40:55Z")

</div>

We are using ember-data in order to get data from our backend. When the user logs in the server does the authentication and sends a jwt token back

---

<div class="post-metadata">

**Author:** ![runspired](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/runspired/32/18654_2.png) [@runspired](https://discuss.emberjs.com/u/runspired)\
**Post date:** [December 31, 2024, 10:28pm UTC](https://discuss.emberjs.com/t/ember-app-does-not-send-sessionid-back-to-server/21391/8 "2024-12-31T22:28:05Z")

</div>

if the jwt token is not returned as a session token you’ll have to manually include it in the headers of the request. When using ember-data, if using newer patterns (e.g. RequestManager) you’d set this up in a handler, if using older patterns (e.g. adapters/serializers) you’d set this up in your adapter.

---

<div class="post-metadata">

**Author:** ![Marco\_Musolf](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/marco_musolf/32/17400_2.png) [@Marco\_Musolf](https://discuss.emberjs.com/u/Marco_Musolf)\
**Post date:** [January 1, 2025, 11:39am UTC](https://discuss.emberjs.com/t/ember-app-does-not-send-sessionid-back-to-server/21391/9 "2025-01-01T11:39:52Z")

</div>

Thanks for your help. I have finally made it. the Problem was missing Headers from Server.
