ASP.NET和会话 - 新的浏览器与新浏览器窗口 [英] ASP.NET and Sessions - New Browser Instance versus New Browser Window

查看:100
本文介绍了ASP.NET和会话 - 新的浏览器与新浏览器窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望有人能澄清这个问题对我来说,并解释ASP.NET是如何决定何时对待像一个新的会话。

I'm hoping someone can clarify this behavior for me, and explain how ASP.NET is deciding when to treat something like a new Session.

A)在Internet Explorer中我加载有问题的ASP.NET站点。它启动一个新的会话。

B)如果我去菜单文件 - 新窗口...它保持在同一会话中

C)如果我启动Internet Explorer的新实例,并加载相同的页面开始新的会话。

A) In Internet Explorer I load the ASP.NET site in question. It starts a new Session.
B) If I go to menu File - New Window... it stays within the same Session.
C) If I launch a new instance of Internet Explorer and load the same page it starts a new Session.

我很困惑一步C.我期待它基于我的远程IP是同一个会话。

什么是IIS / ASP.NET做决定,这是一个新的会话?
难道是看着我的远程端口,IE浏览器的新实例使用?当你踢了一个新的窗口文件 - 新建使用相同的远程端口父

I'm confused by step C. I'm expecting it to be the same session based on my remote IP.
What is IIS / ASP.NET doing to decide that this is a new session? Is it looking at my remote port that the new instance of IE is using? When you kick up a new window with File - New it uses the same remote port as the parent.

推荐答案

在IIS / ASP.NET会话是基于与会话范围饼干,这意味着当浏览器被关闭,他们被摧毁,显然他们不共享在Internet Explorer中的不同的进程。

Sessions in IIS/ASP.NET are based on cookies with a session scope, meaning that they get destroyed when the browser is closed, and apparently they are not shared within different processes of Internet Explorer.

当你打开一个新的浏览器窗口,文件>新建窗口的窗口将被作为第一个相同的方法(即同一IEXPLORER.EXE)处理。当您从开始菜单劳克IE你得到一个新的过程,你现在必须在任务管理器以下两个IEXPLORER.EXE。我认为,这只是IE 7将产卵多个进程。

When you open a new browser window with File > New Window the window will be handled by the same process as the first (i.e. the same iexplorer.exe). When you lauch IE from the start menu you get a new process, and you will now have two iexplorer.exe in the Task Manager. I think that it's only IE 7 that will spawn multiple processes.

作为一个方面说明,IE 8将有每个标签/窗口,一个单一的过程,像谷歌Chrome浏览器了。我不知道如果这些浏览器共享amongs过程会话cookie,但它肯定是使用这些浏览器中的一个测试时要记住。

As a side note, IE 8 will have have a single process per tab / window, like Google Chrome has. I don't know if these browsers share session cookies amongs the processes, but it's certainly something to keep in mind when testing using one of these browsers.

这篇关于ASP.NET和会话 - 新的浏览器与新浏览器窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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