It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Refused to set unsafe header "cookie" Edited

MP Jan 26, 2018

Hi all,

I'm receiving this error trying to use via jquery the cookie with the previously opened session:

jQuery.ajax({
type: "GET",
url: "http://xxxx.xxxx.xxxx.xxxx/rest/api/2/issue/myissue",
contentType: "application/json",
beforeSend: function (request) {
request.setRequestHeader("cookie", document.cookie);
},
error: function (request, status, error) {
console.log('Error');
},
success: function (data) {
console.log('Success');
}
});

Does anyone know which is the proper way to use this cookie for ajax calls?

After this error I also receive "The 'Access-Control-Allow-Origin' header contains multiple values".

Thanks in advance.

1 answer

0 votes
Jennifer van Leeuwen Atlassian Team Aug 07, 2018

Hello MP. 

A little bit late, however, I think that you are being affected by JRASERVER-59101. The work around is to setup a proxy and rewrite Access-Control-Request-Method header. Please see the bug report for more details. I believe that this post in our Community could also be of interest to you:  https://community.atlassian.com/t5/Answers-Developer-Questions/Cross-Origin-Resource-Sharing-with-JIRA-REST-API-and-Javascript/qaq-p/484801

Hope this helps! 

Cheers,
Jennifer van Leeuwen | Atlassian Support

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Jira

Try Jira Cloud for Outlook: Organize your work without leaving your inbox

Hi Atlassian community, My name is Max and I work on the product integration team at Atlassian. I am pleased to announce the early access program for the Jira Cloud add-in for Outlook. This add-in...

805 views 0 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you