PC Review


Reply
Thread Tools Rate Thread

2 sessions, 2 browser windows

 
 
news-server.maine.rr.com
Guest
Posts: n/a
 
      6th Feb 2007
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



 
Reply With Quote
 
 
 
 
Laurent Bugnion [MVP]
Guest
Posts: n/a
 
      7th Feb 2007
Hi,

news-server.maine.rr.com wrote:
> 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


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
 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      7th Feb 2007
"Laurent Bugnion [MVP]" <galasoft-(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

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


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


 
Reply With Quote
 
Laurent Bugnion [MVP]
Guest
Posts: n/a
 
      8th Feb 2007
Hi Mark,

Mark Rae wrote:
> "Laurent Bugnion [MVP]" <galasoft-(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>> 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.

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


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
 
Reply With Quote
 
Laurent Bugnion [MVP]
Guest
Posts: n/a
 
      8th Feb 2007
Hi Mark,

Mark Rae wrote:
> "Laurent Bugnion [MVP]" <galasoft-(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>> 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.

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


OK, I got it. To have the SessionID set consistently on the server side,
you need to actually use the Session object. If you just observe the
SessionID, but you don't actually use the Session object for storage,
then the SessionID will be different on every request. I have to admit,
I was not aware of this. IIRC, it was different in 1.1 (but I might be
wrong).

Anyway, if you use the Session object for storage, and then observe the
session ID, it will be consistent when refreshing the page, and it will
also be the same if you open a new window using Ctrl-N.

HTH,
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
 
Reply With Quote
 
=?ISO-8859-1?Q?G=F6ran_Andersson?=
Guest
Posts: n/a
 
      8th Feb 2007
Laurent Bugnion [MVP] wrote:
> Also, what happens with
> Firefox?


In Firefix you can only have one instance of the browser application, so
you can't open separate sessions.

--
Göran Andersson
_____
http://www.guffa.com
 
Reply With Quote
 
=?ISO-8859-1?Q?G=F6ran_Andersson?=
Guest
Posts: n/a
 
      8th Feb 2007
Laurent Bugnion [MVP] wrote:
> OK, I got it. To have the SessionID set consistently on the server side,
> you need to actually use the Session object. If you just observe the
> SessionID, but you don't actually use the Session object for storage,
> then the SessionID will be different on every request. I have to admit,
> I was not aware of this. IIRC, it was different in 1.1 (but I might be
> wrong).


I would rather suspect a change in IIS than a change in the framework.

--
Göran Andersson
_____
http://www.guffa.com
 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      8th Feb 2007
"Laurent Bugnion [MVP]" <galasoft-(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> OK, I got it. To have the SessionID set consistently on the server side,
> you need to actually use the Session object. If you just observe the
> SessionID, but you don't actually use the Session object for storage, then
> the SessionID will be different on every request. I have to admit, I was
> not aware of this. IIRC, it was different in 1.1 (but I might be wrong).


Interesting...

> Anyway, if you use the Session object for storage, and then observe the
> session ID, it will be consistent when refreshing the page, and it will
> also be the same if you open a new window using Ctrl-N.


So it would seem...!

I wonder just how absolutely consistent this is across client OS / browser
and version of IIS on the webserver...?


 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      8th Feb 2007
"Göran Andersson" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...

> In Firefix you can only have one instance of the browser application, so
> you can't open separate sessions.


Utter nonsense!

Click the FireFox icon three times - three FireFox windows...


 
Reply With Quote
 
=?ISO-8859-1?Q?G=F6ran_Andersson?=
Guest
Posts: n/a
 
      9th Feb 2007
Mark Rae wrote:
> "Göran Andersson" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>
>> In Firefix you can only have one instance of the browser application, so
>> you can't open separate sessions.

>
> Utter nonsense!


Not at all.

Just because you don't understand some information, it's not
automatically nonsense.

>
> Click the FireFox icon three times - three FireFox windows...
>


Yes, three windows, but one application instance.

Open the process list in the task manager and count it, if you like.

--
Göran Andersson
_____
http://www.guffa.com
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clearing Cache - multiple browser sessions - what happens? =?Utf-8?B?RWx2aXNzaWFu?= Windows XP Internet Explorer 1 22nd Sep 2006 06:31 AM
Can I use Netscape as my browser for practice sessions =?Utf-8?B?endlZWJv?= Microsoft Excel New Users 1 18th Mar 2006 11:25 PM
Session variable crossing Browser sessions tshad Microsoft ASP .NET 0 21st Feb 2005 08:26 PM
new browser window and Sessions David Microsoft C# .NET 2 24th Jan 2005 08:05 PM
Share sessions between two browser from same machine Tu-Thach Microsoft Dot NET Framework 0 18th Jul 2003 02:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:11 PM.