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
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
相关文章推荐
- 浏览器数据存储:Cookie和Session,localStorage 和 sessionStorage
- 购物车的实现及Cookie,session,数据库存储的优缺点
- 将PHP的session数据存储到数据库中的代码实例
- php实现session数据存储到数据库
- 将PHP的session数据存储到数据库中的代码实例
- 本地存储(cookie&&sessionStorage&&localStorage)
- android菜鸟学习笔记20----Android数据存储(四))Android数据库操作
- 请单击下面的按钮,以重定向到可以选择新数据存储区的页。下面的消息可能会有助于诊断问题: 无法连接到 SQL Server 数据库。
- 数据库读取和存储大型数据(图片、音视频文件)的函数封装
- redis数据库数据的存储方式
- Android之数据存储----使用LoaderManager异步加载数据库
- 师门技术论坛:数据库并发访问、数据库多点并发访问、大数据存储
- 数据存储之SQLite -- 如何查看数据库文件(基于AS开发工具)
- 存储timestamp的数据类型到数据库中的几行代码
- iOS数据存储--数据库
- PHP将session信息存储到数据库的类实例
- Android本地数据存储之SQLite关系型数据库 ——SQLiteDatabase
- ios数据存储——数据库:SQlite3以及第三方库FMDB
- 【Android】数据存储数据库SQLite(之前有看到的一篇关于SQLite文章,简单明了、覆盖较全面适合学习)
- 数据存储之数据库操作