【问题标题】:enable cookie.js in Chrome在 Chrome 中启用 cookie.js
【发布时间】:2012-10-29 17:15:24
【问题描述】:

我为我的应用程序使用 jquery.cookie.js 插件(在服务器内,仅 html5)

以下代码适用于 IE9 和 firefox,但不适用于 Chrome:

$.cookie('the_cookie', 'the_value');

如果我使用选项 --enable-file-cookies 运行 Chrome 就可以了,并且我的 Chrome 浏览器支持 cookie

我的问题:有没有办法通过 javascript 而不是终端启用此选项?

【问题讨论】:

  • 将其移动到服务器或通过本地服务器运行,file:/// 方案还有许多其他限制,您也会遇到。

标签: javascript html google-chrome cookies


【解决方案1】:

如果您在 'localhost' 上测试,chrome 会出现问题。改用 127.0.0.1

【讨论】:

  • All 表明他甚至没有本地 Web 服务器
【解决方案2】:

不,这是 Google Chrome 中与安全相关的方法。如果您能够启用客户端禁用的某些功能,这应该是 Chrome 中的一个错误。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-11-07
    • 2010-12-09
    • 2016-12-20
    • 2013-05-18
    • 1970-01-01
    • 2017-04-01
    • 2013-02-06
    相关资源
    最近更新 更多