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) 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.
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.
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.
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.
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.
By default, ASP.NET tracks sessions through cookies. A new IE instance does not have the session cookie, resulting in a new session. However, using File -> New Window from an existing IE window will create a new window with the same cookies as the "parent", allowing ASP.NET to use the existing session.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With