黑白会话和Cookies [英] difference b/w session and coookies

查看:89
本文介绍了黑白会话和Cookies的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

黑白会话和傻瓜有什么区别?

解决方案

会话 1.是按用户存储在服务器上的内存(或替代的会话状态)中.会话使用cookie(会话密钥)将用户绑定到会话.这意味着用户计算机上的cookie中没有存储敏感"数据.

2.会话可以存储任何类型的数据,因为
值是对象"的数据类型
3.我们无法禁用会话.可以使用会话
也没有cookie(通过禁用cookie)
4.会话的缺点是它是
服务器上的负担/开销
5.会话称为非持久性Cookie
因为它的使用寿命可以手动设置



Cookie 1.按用户存储在用户计算机上. Cookie通常只是一些信息. Cookies通常用于简单的用户设置颜色首选项等.绝不能将任何敏感信息存储在cookie中.

2. Cookies只能存储字符串"数据类型
3.我们可以禁用Cookie
4.因为值是字符串,所以没有安全性
5.我们有持久性和非持久性Cookie


会话是用户从第1页加载到注销或在session_timeout持续时间内处于非活动状态的用户交互过程的生命周期.通常,这是服务器端引用.

Cookie是存储在客户端的小文件,其中包含可用于记住用户首选项,购物篮内容session_tokens等的数据,Cookie的生命周期由Cookie的到期日期或用户是否通过浏览器删除这些Cookie来确定会话变量是服务器对象,并保存在服务器内存中; Cookies是smal文件,用于存储用户数据并保存在客户端系统中.使用Session具有很多灵活性,而Cookie受限制并且还取决于浏览器.

还有很多东西,有关详细信息,请参见以下链接.
ASP.NET Cookie入门指南

在ASP.Net中浏览会话


What is the difference b/w session and coookies?

解决方案

Sessions1. are stored per-user in memory(or an alternative Session-State) on the server. Sessions use a cookie(session key) to tie the user to the session. This means no "sensitive" data is stored in the cookie on the users machine.

2. Session can store any type of data because the
value is of datatype of "object"
3.we cannot disable the sessions.Sessions can be used
without cookies also(by disabling cookies)
4. The disadvantage of session is that it is a
burden/overhead on server
5. Sessions are called as Non-Persistent cookies
because its life time can be set manually



Cookies 1. are stored per-user on the users machine. A cookie is usually just a bit of information. Cookies are usually used for simple user settings colours preferences ect. No sensitive information should ever be stored in a cookie.

2. Cookies can store only "string" datatype
3. We can disable cookies
4.Since the value is string there is no security
5. We have persistent and non-persistent cookies


A session is the lifecycle of a users interaction of a site from 1st page load through to when they log out or are inactive for session_timeout duration. Typically this is server side references.

Cookies are small files that are stored at the client side which contain data that could be used to remember user preferences, shopping basket contents session_tokens etc., the cookie lifecycle is determined by when cookie expiry date or if the user deletes these cookies via the browser or some other mechanism.


Session varaibles are server objects and saved at server memory and Cookies are smal files,used to store user''s data and save at client'' system.Also we have alot of flexiblity using Session while cookies are limited and also depends on browsers.

There are a lot more things,for details have a look to the following link.
Beginner''s Guide To ASP.NET Cookies

Exploring Session in ASP.Net


这篇关于黑白会话和Cookies的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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