什么是会话 Cookie?

发布于 2024-11-30 03:56:53 字数 72 浏览 0 评论 0原文

有人可以解释一下 .NET 中的会话 cookie 是什么以及如何将数据写入其中吗?

谢谢,

萨钦

Can someone please explain what a session cookie is in .NET and how I write data into one?

Thanks,

Sachin

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

小矜持 2024-12-07 03:56:53

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

复制自 AllAboutCookies

Session cookies allow users to be recognized within a website so any page changes or item or data selection you do is remembered from page to page. The most common example of this functionality is the shopping cart feature of any e-commerce site.

copied from AllAboutCookies

飘过的浮云 2024-12-07 03:56:53

会话 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).

请参阅 了解详细信息

Session Cookies

    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.

Session Cookies in ASP.Net

    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).

See this for details

书间行客 2024-12-07 03:56:53

例如;

您访问 http://www.blablabla.com/message.aspx 并看到 请登录消息。

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

Session Cookies 就会发生这种情况。

For example;

You visit http://www.blablabla.com/message.aspx and you see Please Login message.

You login the site. After that, you re-write http://www.blablabla.com/message.aspx in your browser, the automaticly redirecting your message box.

This is happening with Session Cookies.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文