Angular: get cookie from one request and use in another

独自空忆成欢 提交于 2019-12-12 03:35:51

问题


I have simple Angular app, which can perform some requests over $http to remote service (couchdb) at example.com/.../myservice. Service requires auth, which done by calling specified address example.com/_session with name and password and it returns with session cookie AuthSession. Problem is that cookie is not used when calls to service is done. Maybe problem caused because cookie is per-session Http-only (and that's can't be changed).

I think the solution is grabbing cookie from auth response, store and force it into service calls manually. But I don't know how to:

  1. Get cookie from $http response
  2. Force it with $http response

Any suggestions?

UPD: pics

All cookies

but available only this

Auth cookie, which sent to /_session request, but not to others


回答1:


There's no solution, according to this

Now I think that couchdb is a source of problem. So, I'll try to find another ways to do auth in couch manually.



来源:https://stackoverflow.com/questions/34309292/angular-get-cookie-from-one-request-and-use-in-another

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!