# Can't set cookie from login kibana 5.4.0

**URL:** <https://discuss.elastic.co/t/cant-set-cookie-from-login-kibana-5-4-0/87271>\
**Category:** Kibana\
**Created:** [May 26, 2017, 3:10pm UTC](https://discuss.elastic.co/t/cant-set-cookie-from-login-kibana-5-4-0/87271 "2017-05-26T15:10:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rgheleri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rgheleri/32/18497_2.png) [@rgheleri](https://discuss.elastic.co/u/rgheleri)\
**Post date:** [May 26, 2017, 3:10pm UTC](https://discuss.elastic.co/t/cant-set-cookie-from-login-kibana-5-4-0/87271/1 "2017-05-26T15:10:37Z")

</div>

Hi,  
I know this is a common issue and looking around the forum no other topic could solve it.

My problem is very similar to this topic below. I can make the login by /api/security/v1/login by ajax request and I can get the cookie, but I canot set it with javascript. When I try to set the domain, something goes wrong and the cookie is not created. I am trying some workaround but without success. I am trying to open iframes to visualize charts without the user need to insert username/password. Am I doing something wrong or missing something?

elasticsearch version: 5.4.0  
kibana version: 5.4.0

Topic related:

> [@Authenticating to iframe-embedded Kibana dashboard](https://discuss.elastic.co/t/authenticating-to-iframe-embedded-kibana-dashboard/71129/7):
>
> Sorry for the delay, @rupaln and sorry for giving incomplete advice. I was able to get the Kibana server to respond with a cookie header by POSTing to /api/security/v1/login with a JSON request body of { "password": "\<YOURPASSWORD\>", "username": "\<YOURUSERNAME\>" } and the appropriate kbn-version: 5.1.1 header.

---

<div class="post-metadata">

**Author:** ![tylersmalley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylersmalley/32/8833_2.png) [@tylersmalley](https://discuss.elastic.co/u/tylersmalley)\
**Post date:** [May 30, 2017, 4:16am UTC](https://discuss.elastic.co/t/cant-set-cookie-from-login-kibana-5-4-0/87271/2 "2017-05-30T04:16:45Z")

</div>

Your issue is probably related to cross-origin and information related to setting CORS was given [here](https://discuss.elastic.co/t/auto-authenticate-kibana-5-3-dashboard-embedded-in-iframe/85059/7?u=tsmalley).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 27, 2017, 4:17am UTC](https://discuss.elastic.co/t/cant-set-cookie-from-login-kibana-5-4-0/87271/3 "2017-06-27T04:17:34Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
