开发者

Can the number of cookies set on localhost create problems?

I'm unable to log into localhost and wondering if this is开发者_高级运维 due to having 40-50 cookies on my machine.

Could this be the reason?

The site is set up to create a cookie for each article that's being viewed.


Don't create this many cookies.

Either

  • Serialize the IDs of all viewed articles into one cookie

  • Have one long-term cookie with a random ID, and store the associated data (article views, etc.) on server side. You'd have to do some garbage collection for this though, like clear out keys that haven't been used for more than six months or whatever.

that said, as @Michael points out, this is not necessarily the root cause of your problem. You'd have to give some more details to get specific answers.


The number of cookies is irrelevant. If there are lots and lots, it will increase the HTTP request size and slow things down a bit or even (as pointed out in comments below) exceed the maximum HTTP request size allowed, but if you are having problems it is more likely that you have some conflict like two cookies with the same name overwriting one another.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜