如何为所有浏览器存储无限数量的Cookie条目 [英] How to store unlimited amount of cookies entries for all browsers

查看:99
本文介绍了如何为所有浏览器存储无限数量的Cookie条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个浏览器解决方案,该解决方案需要将大量数据存储到cookie中.
我们谈论的是1000多个入口点.不幸的是,大多数浏览器在功能上都有局限性
保存cookie(即Firefox 3 Mac OS 10.6.6 =每个域150个参数).

在用户单击保存按钮后,我也确实将数据存储在MySQL数据库中,而他确实希望保持这些数据的持久性.

我以这种方式设计它的原因是:
A.浏览器崩溃保护系统到位,或者用户关闭窗口/选项卡
B.用户可以方便地返回同一页面并继续从事他的项目

请让我知道您对此的想法或建议.

非常感谢!

I created a browser solution that needs to store quite a bit of data into cookies.
We talking about 1000+ entry points. Unfortunately most browsers have limitations if it comes to
cookie saving (i.e. Firefox 3 Mac OS 10.6.6 = 150 parameter per domain).

I also store the data in a MySQL database after the user clicks on the save button that he really wants to keep those data persistent.

The reason I designed it this way is to have:
A. a browser crash protection system in place, or the user closes the window/tab
B. it is convenient for the user to come back to the same page and continue working on his project

Please let me know your thoughts or suggestions on that.

Many thanks!

推荐答案

您难道不能只是将数据库中的数据保存到LastSession表中?
Couldn''t you just save that data in the database into a LastSession table?


它是不受浏览器方面的限制.阅读说明cookie限制的RFC2109.

It is not a limitation on the browser side. Read RFC2109 which states cookie limitations.

6.3  Implementation Limits
Practical user agent implementations have limits on the number and
   size of cookies that they can store.  In general, user agents'' cookie
   support should have no fixed limits.  They should strive to store as
   many frequently-used cookies as possible.  Furthermore, general-use
   user agents should provide each of the following minimum capabilities
   individually, although not necessarily simultaneously:

      * at least 300 cookies

      * at least 4096 bytes per cookie (as measured by the size of the
        characters that comprise the cookie non-terminal in the syntax
        description of the Set-Cookie header)

      * at least 20 cookies per unique host or domain name



最好的选择是将数据存储在数据库中,然后将数据ID/密钥保存在cookie中.



You best bet is to store the data in your db and then you can save your data id / key in the cookie.


这篇关于如何为所有浏览器存储无限数量的Cookie条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆