HTTP会话的范围是什么?

编程入门 行业动态 更新时间:2024-10-11 19:14:46
本文介绍了HTTP会话的范围是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

HTTP会话的范围究竟是什么?

What exactly is the scope of an HTTP session?

我一直在谷歌搜索但似乎无法得到一个直接的答案 - 一个会话应该是在用户关闭浏览器时清除,但我不清楚 - 这是否意味着关闭浏览器窗口或退出浏览器应用程序?同时打开两个浏览器窗口的用户是否维护两个不同的会话?如果同一个会话,浏览器标签是否总是一部分?

I've been googling this but can't seem to get a straight answer- A session is supposed to get cleared out "when a user closes their browser", but that's unclear to me- Does that mean closing the browser window, or quitting the browser application? Does a user with two browser windows open at the same time maintain two different sessions? And are browser tabs always part if the same session?

推荐答案

这取决于您在应用程序中跟踪会话的方式。

This will depend on how you are tracking sessions in your application.

默认情况下,它们由 HttpOnly cookies跟踪。这意味着如果用户关闭当前选项卡,则他不会松开会话。如果他关闭浏览器虽然他会失去会话。

By default they are tracked by HttpOnly cookies. This means that if the user closes the current tab, he doesn't loose the session. If he closes the browser though he looses the session.

如果您使用无cookie模式跟踪会话( cookieless =true),ASP.NET将追加所有网址的自定义标记,表示用户可以在同一浏览器实例的2个不同标签上记录2个不同的会话。

If you use a cookieless mode to track sessions (cookieless="true"), ASP.NET will append a custom token to all urls meaning that a user can be logged with 2 different sessions on 2 different tabs of the same browser instance.

更多推荐

HTTP会话的范围是什么?

本文发布于:2023-11-28 14:21:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1642766.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:HTTP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!