角:从一个请求获取cookie并在另一个使用 [英] Angular: get cookie from one request and use in another
问题描述
我有简单的角度应用程序,它可以执行超过 $ HTTP
部分请求远程服务(CouchDB的) example.com / ... /为MyService
。服务需要身份验证,它通过调用指定的地址 example.com/_session
与名和密码,并将其与会话cookie返回 AuthSession $ C $完成C>。问题是,当对服务请求完成的cookie不被使用。也许问题造成的,因为cookie是每个会话仅HTTP(而这不能更改)。
我觉得溶液从AUTH响应,存储抢夺饼干,迫使其投入使用手动调用。但我不知道如何:
- 从$ HTTP响应获取的cookie
- 使用$ HTTP响应 强制
有什么建议?
UPD:图片
所有Cookie
但仅此P>
验证cookie,它发送到 / _会议
的要求,而不是别人。
有没有解决的办法,根据这个
现在我认为,CouchDB是问题的根源。
所以,我会尽力找到另一个方法做手工AUTH在沙发上。
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
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.
这篇关于角:从一个请求获取cookie并在另一个使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!