admin管理员组文章数量:1385024
I found this link
But at the bottom it says This information is likely no longer up to date. So my question is, will http_only cookies be sent with AJAX? Can the response via AJAX set http_only cookies?
Edit 1: Let's say an user logged in to the system. His session started and http_only cookie is set. He tries to fetch list of his friends via AJAX and sends JSON. When making the AJAX request, do I need to make anything special to say to send cookies or not? Will each request send the cookies to the server by default? Will the response send back cookies (let's say I am updating users' time for last activity)?
I found this link
But at the bottom it says This information is likely no longer up to date. So my question is, will http_only cookies be sent with AJAX? Can the response via AJAX set http_only cookies?
Edit 1: Let's say an user logged in to the system. His session started and http_only cookie is set. He tries to fetch list of his friends via AJAX and sends JSON. When making the AJAX request, do I need to make anything special to say to send cookies or not? Will each request send the cookies to the server by default? Will the response send back cookies (let's say I am updating users' time for last activity)?
Share Improve this question edited May 23, 2017 at 10:31 CommunityBot 11 silver badge asked Dec 14, 2014 at 17:12 Ezio_Ezio_ 5933 gold badges11 silver badges24 bronze badges 1-
you need to set the
withCredentials
option. – Daniel A. White Commented Dec 14, 2014 at 18:18
1 Answer
Reset to default 8Yes, they will.
The HttpOnly
makes cookies not appear in document.cookie
and XMLHTTPRequest.getAllResponseHeaders
. It doesn't prevent them from being sent with HTTP requests, with the exception of cross-domain HTTP requests (which it doesn't sound like you're using here).
本文标签: javascriptWill httponly cookies be sent with AJAXStack Overflow
版权声明:本文标题:javascript - Will http_only cookies be sent with AJAX? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744538662a2611472.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论