简体   繁体   English

如何定义将Cookie保存在FireFox的选项(javascript)

[英]How to define the option to save the cookies at FireFox (javascript)

In Firefox, there are cookie settings: Always, Never, From Visited: 在Firefox中,有cookie设置:始终,从不,来自访问者:

在此处输入图片说明

I'm from the program to determine which of these modes is enabled as follows: (Never and From Visited) 我从程序中确定如下启用了哪些模式:(从不访问和从访问开始)

If I understood your question correctly, you want to check with JavaScript whether the browser has cookies set. 如果我正确理解了您的问题,则希望使用JavaScript检查浏览器是否设置了cookie。 Right? 对?

If so, then a really good way of knowing it is to test it. 如果是这样,那么了解它的一个很好的方法就是对其进行测试。

Simply set on cookie and then see if you can get it back on your next request. 只需在Cookie上进行设置,然后查看是否可以在下一个请求时将其取回。 That will tell you what you want. 那会告诉你你想要什么。


ADDENDUM 附录

If the user chooses not to accept any cookies or delete them within 1 day, there is nothing you can do through you code. 如果用户选择在1天之内不接受任何cookie或将其删除,则您无法通过代码进行任何操作。 That is on your user. 那就是你的用户。 If he/she does not want to save cookies then they should not complain about your product because ie the automatic login or the autofill will not work. 如果他/她不想保存cookie,则他们不应抱怨您的产品,因为自动登录或自动填充将无法工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM