Set-cookie in response not set for Angular2 post request

后端 未结 3 1471
栀梦
栀梦 2020-12-05 16:04

When I make a put request in Angular2, I receive the expected set-cookie in the response. However my browser (tried both Chrome and Firefox) refuses to set the cookie.

3条回答
  •  被撕碎了的回忆
    2020-12-05 16:28

    Indeed a CORS issue. From Angular2 RC2 on, you just need to

    this.http.get('http://my.domain.com/request', { withCredentials: true })
    

提交回复
热议问题