您的位置:首页 > 数据库

session、cookie及数据库存储数据时的区分/方法论(英文)

2011-12-02 13:34 344 查看
原文帖中某人的回复:

It depends on your site/app. The general rules are something like this:

Saving in the session works well if the number of simultaneous users is fairly low and the the data is relatively small.

Saving in a cookie works well if the number of simultaneous users is high and the size of the data is relatively low. Obviously cookies are publicly viewable so if it is sensitive such as email then it should be encrypted.

Saving in the database works well if the size of the data is large.

Note. As others have said if your using a web farm then I would forget about saving in the session.
原文帖链接:

http://stackoverflow.com/questions/1233016/store-user-information-in-session
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: