Setting request cookies angular2 http post request
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a login service that performs an http request (to a php backend server) and returns a cookie. After login this cookie is needs to be used in all further requests done by the client. loginservice: login(userCredentials:UserCredentials):Observable<any> { this.request.ServiceType = "Connect" this.request.SessionId = "sessionlessrequest" this.request.Compression = "no" this.request.Parameters = userCredentials; let jsonRequest = JSON.stringify(this.request) return this.http.post("http://localhost/request.php", "data="+ jsonRequest, {