问题
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:
- Get cookie from $http response
- 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