什么是会话Cookie?

时间:2011-08-15 11:50:53

标签: c# session cookies

有人可以解释.NET中会话cookie的内容以及我如何将数据写入一个?

谢谢,

萨钦

3 个答案:

答案 0 :(得分:0)

会话cookie允许用户在网站内被识别,因此您可以在页面之间记住您所做的任何页面更改或项目或数据选择。此功能最常见的示例是任何电子商务网站的购物车功能。

AllAboutCookies

复制

答案 1 :(得分:0)

会话Cookie

    Webpages have no memories. A user going from page to page will be treated by the 
website as a completely new visitor. Session cookies enable the website you are visiting to 
keep track of your movement from page to page so you don't get asked for the same 
information you've already given to the site.

ASP.Net中的会话Cookie

    When a user connects to an ASP.NET application, a unique session ID will be affiliated 
with the user. If nothing is put in the session however, no cookie will be sent to the 
browser. This means that the user will get a new session ID the next time a new url is open or 
the page is refreshed. If something is put on the session (HttpContext.Current.Session["Hello] 
= "hello") however, ASP.NET will issue a cookie called ASP.NET_SessionId. This cookie contains 
the user's session ID and the cookie will expire at the end of the session (when you close 
your browser).

有关详细信息,请参阅this

答案 2 :(得分:0)

例如;

您访问http://www.blablabla.com/message.aspx并看到Please Login消息。

您登录该网站。之后,您在浏览器中重新编写http://www.blablabla.com/message.aspx,自动重定向您的消息框。

这发生在Session Cookies