Get HTTP-only cookie from Windows 8 JS App(从 Windows 8 JS 应用程序获取仅 HTTP cookie)
问题描述
我正在制作一个 Javascript Windows 8 应用程序,用户在该应用程序中连接到我的服务器并登录.目前,我正在尝试使用 XmlHttpRequest 对象来执行此操作(特别是 WinJS.xhr),但是当我得到getAllResponseHeaders(),Set-Cookie 标头不存在(因为它是一个 Http-only cookie).
I am making a Javascript Windows 8 app in which the user connects to my server and logs in. Currently, I am trying to use the XmlHttpRequest Object to do so (specifically, WinJS.xhr) but when I get the output of getAllResponseHeaders(), the Set-Cookie header isn't there (because it is an Http-only cookie).
有没有办法从 JS Windows 8 应用程序中获取仅限 http 的 cookie?
Is there any way to get http-only cookies from a JS Windows 8 app?
非常感谢所有帮助,我总是接受答案!
All help is greatly appreciated and I always accept an answer!
推荐答案
事实证明,Windows 8 应用程序已经能够通过响应标头中的 XMLHttpRequest 获取仅限 HTTP 的 cookie.但是,系统会以与 iOS 相同的方式自动处理 cookie.这看起来很合乎逻辑,因为 coder 不应该负责 cookie 处理,底层框架会这样做.
As it turns out, Windows 8 apps are already able to get HTTP-only cookies with the XMLHttpRequest from the response's header. However, the system handles the cookies automatically in the same way iOS does. This seems very logical, since the coder should not be responsible for cookie handling, the underlying framework does that.
这篇关于从 Windows 8 JS 应用程序获取仅 HTTP cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:从 Windows 8 JS 应用程序获取仅 HTTP cookie


基础教程推荐
- Vue 3 – <过渡>渲染不能动画的非元素根节点 2022-01-01
- 如何使用TypeScrip将固定承诺数组中的项设置为可选 2022-01-01
- 用于 Twitter 小部件宽度的 HTML/CSS 2022-01-01
- html表格如何通过更改悬停边框来突出显示列? 2022-01-01
- 如何使用JIT在顺风css中使用布局变体? 2022-01-01
- Electron 将 Node.js 和 Chromium 上下文结合起来意味着 2022-01-01
- 自定义 XMLHttpRequest.prototype.open 2022-01-01
- 我可以在浏览器中与Babel一起使用ES模块,而不捆绑我的代码吗? 2022-01-01
- Chart.js 在线性图表上拖动点 2022-01-01
- 直接将值设置为滑块 2022-01-01