什么是会话和会话变量? [英] What is session and session variables?

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

问题描述

您能指导我什么是会话和会话变量吗?我不需要比较ASP会话和ASP.NET会话,因为我对ASP一无所知.

Can you please guide me what is session and session variables? I don't need a comparison of ASP session and ASP.NET session because I don't know anything about ASP.

我也看过很多关于会议类型的文章.但是,我仍然无法正确理解什么是会话以及ASP.NET中的会话变量是什么?

I have seen many articles on types of session as well. But still I can't understand correctly what is session and what are session variables in ASP.NET?

推荐答案

会话-用于跟踪每个用户的请求.因此,每次将网页发回asp.net运行时都知道请求来自哪个用户. 现在,由于HTTP是无状态协议,这意味着来自同一用户的每个请求都像对它的新请求一样. 因此,为了维护会话,Asp.Net具有Session变量.

Session - Is to keep track of each user's request. So each time the web page is posted back asp.net runtime knows from which user the request is coming from. Now since HTTP is a stateless protocol, meaning each request from the same user is like a new request to it. So, to maintain a session Asp.Net has Session variables.

会话变量-会话变量是由ASP.NET运行时在服务器端维护的变量.每个用户都有一个唯一的编号,称为SessioID.在第一个用户请求之后,此会话将存储在客户端的cookie(如果浏览器支持cookie)中.当客户端回发页面时,该cookie在请求标头中可用.因此,现在服务器知道此用户请求来自哪个用户.除此之外,您还可以在会话变量中存储特定于用户的信息,这些信息将在服务器端提供.

Session Variables- The session variables are variables maintained on server side by asp.net runtime. Each user is identified by a a unique number called SessioID. This session is stored in a cookie (if browser supports cookie) on client side after the first user request. when the client posts back a page , this cookie is available in the request header. So now server knows that this user request is coming from which user. Besides this you can also store user specific information in session variables, which will be availale on server side.

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

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