2个会话,2个浏览器窗口 [英] 2 sessions, 2 browser windows

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

问题描述




我正在寻找示例代码或您的输入,关于如何使用新会话创建一个新窗口

,同时父窗口保留在原始会话中。


例如,父窗口中的链接将在新的
会话中打开一个新窗口,但是父会话仍然有效。


这可能吗?


感谢您的任何提示。


Frank

Hi,

I''m looking for sample code or your input, on how to create a new window
with a new session, while the parent window remains in its original session.

For example, a link from the parent window would open a new window in a new
session, but the parent session would still be valid.

Is this possible?

Thanks for any tips.

Frank

推荐答案




news-server.maine.rr。 com写道:
Hi,

news-server.maine.rr.com wrote:




我正在寻找示例代码或您的输入,关于如何创建新窗口
带有新会话的
,而父窗口仍保留在原始会话中。


例如,来自父窗口的链接将打开一个新窗口新的

会话中的窗口,但父会话仍然有效。


这可能吗?


感谢您的任何提示。


Frank
Hi,

I''m looking for sample code or your input, on how to create a new window
with a new session, while the parent window remains in its original session.

For example, a link from the parent window would open a new window in a new
session, but the parent session would still be valid.

Is this possible?

Thanks for any tips.

Frank



这是不可能的。对于Web浏览器,会话链接到运行Web浏览器的

进程。如果你启动两个

IE进程的实例(IEXPLORE.EXE),每个实例都会有一个不同的会话ID。

但是,如果你只是打开一个新的窗口当前的实例

IEXPLORE,新窗口将在同一个进程中运行,因此具有相同的会话ID

。无法使用链接在客户端上启动新实例

进程,或者在另一个现有的进程实例中打开一个新窗口。 br />

但是,您可以使用另一种方法来识别您的窗口

(例如使用SessionID和窗口名称的组合,因为

窗口的名称在会话中必须是唯一的),并实现你的

拥有的window-session管理服务器。这不是很难。


另外(你没有确切地知道你有什么样的客户),如果你有一个富有的b $ b富客户端(例如WinForms应用程序),那么你可以从一个客户端启动

多个会话,只使用不同的CookieContainers
每个web请求
。我不认为这就是你在做什么。


问候,

Laurent

- -

Laurent Bugnion [MVP ASP.NET]

软件工程,博客: http://www.galasoft-LB.ch

PhotoAlbum: http://www.galasoft-LB.ch/pictures

支持加尔各答的儿童: http://www.calcutta-espoir.ch

That''s not possible. For the web browsers, the session is linked to the
process in which the web browser runs. If you start two instances of the
IE process (IEXPLORE.EXE), each one will have a distinct session ID.
However, if you just open a new window from the current instance of
IEXPLORE, the new window will run in the same process, thus have the
same Session ID. It is not possible using a link to start a new instance
of a process on the client, or to open a new window in another existing
instance of a process.

What you can do, however, is use another way to identify your windows
(for example using a combination of SessionID and window name, since the
window''s name must be unique inside of a session), and to implement your
own "window-session" management on the server. it''s not very difficult.

Also (you didn''t precise what kind of client you have), if you have a
rich client (for example WinForms application), then you can start
multiple sessions from one client only using different CookieContainers
for each web request. I don''t think it''s what you''re doing though.

Greetings,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch


Laurent Bugnion [MVP]" < ga ********* @ bluewin.chwrote in message

news:uN ************** @ TK2MSFTNGP02.phx.gbl。 ..
"Laurent Bugnion [MVP]" <ga*********@bluewin.chwrote in message
news:uN**************@TK2MSFTNGP02.phx.gbl...

但是,如果您只是从当前实例

IEXPLORE打开一个新窗口,新窗口将在同一个窗口中运行过程,因此具有相同的会话ID。
However, if you just open a new window from the current instance of
IEXPLORE, the new window will run in the same process, thus have the same
Session ID.



这根本不是真的 - 至少,不是IE7 ......


我刚尝试过...在我的网站上打开了一个调试页面,显示了

SessionID,然后点击了Ctrl-N九次 - 每个10个浏览器实例

有一个不同的SessionID ...

This simply is not true - at least, not with IE7...

I just tried it... opened a debug page on my website which shows the
SessionID, then clicked Ctrl-N nine times - each of the 10 browser instances
has a different SessionID...


嗨Mark,


Mark Rae写道:
Hi Mark,

Mark Rae wrote:

" ; Laurent Bugnion [MVP]" < ga ********* @ bluewin.chwrote in message

news:uN ************** @ TK2MSFTNGP02.phx.gbl。 ..
"Laurent Bugnion [MVP]" <ga*********@bluewin.chwrote in message
news:uN**************@TK2MSFTNGP02.phx.gbl...

>但是,如果您只是从当前的IEXPLORE实例中打开一个新窗口,新窗口将在同一个进程中运行,因此具有相同的会话ID。
>However, if you just open a new window from the current instance of
IEXPLORE, the new window will run in the same process, thus have the same
Session ID.



这根本不是真的 - 至少,不是IE7 ......


我刚尝试过...在我的网站上打开了一个调试页面,显示了

SessionID,然后点击了Ctrl-N九次 - 每个10个浏览器实例

有一个不同的SessionID ...


This simply is not true - at least, not with IE7...

I just tried it... opened a debug page on my website which shows the
SessionID, then clicked Ctrl-N nine times - each of the 10 browser instances
has a different SessionID...



我怀疑服务器端问题。当你刷新一个窗口时会发生什么,

是SessionID相同,还是不同?另外,

Firefox会发生什么?
我注意到ASP.NET 2.0中的会话管理发生了很大的变化

与1.1相比。我刚刚在这里进行了一些快速测试,我得到了一个一致的SessionID的麻烦。我不能在今晚测试更多




通常情况下,IE7的行为与IE6相同,并且SessionID附加到

这个过程。


问候,

Laurent

-

Laurent Bugnion [ MVP ASP.NET]

软件工程,博客: http:// www.galasoft-LB.ch

PhotoAlbum: http://www.galasoft-LB.ch/pictures

支持加尔各答的儿童: http://www.calcutta-espoir.ch

I suspect a server-side issue. What happens when you refresh one window,
is the SessionID the same, or is it different? Also, what happens with
Firefox?

I noticed that the session management changed quite a lot in ASP.NET 2.0
compared to 1.1. I just made a few quick tests here and I am having
troubles getting a consistent SessionID. I can''t test more tonight
unfortunately.

Normally, IE7 behaves the same as IE6, and the SessionID is attached to
the process.

Greetings,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch


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

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