Set-cookie in response not set for Angular2 post request
I seems to be a CORS-related issue. Perhaps you could try to set the withCredentials
attribute when executing the HTTP request.
This answer could help you to find out how to do that, especially the Cedric Exbrayat's answer:
Edit
You could extend the BrowserXhr
:
@Injectable()export class CustomBrowserXhr extends BrowserXhr { constructor() {} build(): any { let xhr = super.build(); xhr.withCredentials = true; return <any>(xhr); }}
and override the BrowserXhr
provider with the extended:
bootstrap(AppComponent, [ HTTP_PROVIDERS, provide(BrowserXhr, { useClass: CustomBrowserXhr })]);
If you need more hints about CORS, you could have a look at this link: http://restlet.com/blog/2015/12/15/understanding-and-using-cors/.
Hope it helps you,Thierry