I’m building an Ember demo to convince our company to stop building .jsp pages and start building the front end with Ember!
To convince them, I need to use our existing APIs for data in my demo. I’m not able to get a session cookie through an API. In the current site the session is created with direct a java call . To get around this, I’m trying to send a cookie with the GET request. However, I get a error: "Refused to set unsafe header “Cookie”. How can I send a cookie with a request?
// adapters/account.js
export default DS.RESTAdapter.extend({
host: 'http://localhost:8080/api/v2',
headers: computed('session.authToken', function() {
return {
'Cookie': 'JSESSIONID=A05E839C3BDBF9D7F2B3564E2F598B7B'
};
})
});