home » articles » ASP.NET Session State shared between IE Tabs and IE8

ASP.NET Session State shared between IE Tabs and IE8

change text size: A A A

4/17/2009 by ranganh

“This article has been re-published from - Original Article

ASP.NET Session State shared between IE Tabs and IE8

One of the common problems reported with tabbed browsing in Internet Explorer is that the session state is shared between the tabs. Sample scenario below:-

1. User A opens an IE instance and logs into a website where a session is created.

2. User A opens another tab and tries to access the same website. Without logging in, the user is already inside the session.

3. In this case, its clear that the session is shared between the tabs.

Problems with this behavior

User retrieves a particular record in both the IE Tabs. On one tab, the user deletes the particular record. Parallely on the other tab, user tries to modify the record. There will be a data instability and would throw error.

This behavior has been complained a lot.

However, imagine if it were the other way around i.e.

Sessions not shared between the tabs

Your users signed into your site and are visiting a particular page where there are a list of links (different product links). If your users want to compare 2 products by opening them in 2 different tabs at the same time, they would have to login again for the 2 new tabs. That would be pretty annoying since most people open multiple windows when accessing the same site.

You have a popup in your site, where you want to quickly populate some information and get back to the original site, this wouldnt work since the popup doesnt share the session.

So there are pros and cons to this behavior and people have provided workarounds to check if there is a new instance of IE (not a great approach) or set a hidden field (somewhat okay) to check if it is the same browser etc.,

The reason for this behavior is attributed to the single process that runs the tabs and hence sharing the same session state.

ASP.NET 2.0 offered a simpler solution by way of the following config setting

<sessionState mode="InProc" cookieless="UseUri"></sessionState>

This setting basically appends the Session to the URL of the browser, so your typical URL looks like http://localhost/SampleWeb/(S(afdg3ires1ik0lmjm3pkjtzl))/default.aspx where the highlighted portion manages the session identification.

By this way, one can open multiple tabs and still have different sessions. The only issue with this would be the absolute URLs that are hard coded, referred to, since they change with the appending of the session URI.

In IE8 each of the tabs run under a separate process. This would make you think that the session problem gets lost (or problem is starting :))

However, by default IE8 tabs also share the session state between them to avoid lesser sessions shared within a frame process. Once you launch IE8, there are 2 processes started – frame process and tab process. The frame process manages the tab processes and some of the UI rendering where the tab processes does rest of the stuff - website management.

When an additional tab is opened, there is one more tab process added and it is also managed by the same frame process which got created initially.

If you wish to override this behavior and get a new session, you can chose “File – New Session” . When you do this, instead of one additional process, there are 2 processes created – a frame process and tab process and these dont share session with the original frame process.

Hence, even if you are logged in to a site and have access to session, if you chose “File – New Session” and navigate to the site, it will not share the session.

If you would like to learn more on this, visit the IE Team’s blog post at IE 8 and Reliability

Cheers !!! 

To rate this article please register or login

Author

ranganh ranganh (Member since:2/3/2009)

Comments (2)

  • askvipin 5/29/2009 11:45:44 PM by:  askvipin
    Good Article
  • jyoti_dit 8/7/2009 1:18:45 AM by:  jyoti_dit
    good article

Post a comment

Comment (No HTML)  

Type the characters:
 *
 
   

Related articles

Join CodeAsp.Net for FREE Today!

It's fast, easy and free! Submit articles, get your own blog, ask questions & give answers in the forums, and become a better developer, faster.

enter your email address:

Latest Articles RSS Feed

Latest Articles

  • Hi Friends, Many times we came cross the requirement when we need to access the dropdownlist's selectedindexchanged event inside the gridview, like in a shopping cart changing the item's quantity or binding the other dropdown based on the first dropdown.
  • This is the approach that I have adopted to develop Expandable / Collapsible Panel Control through JavaScript. Please report bugs, errors and suggestions to improve this control.
  • This is my approach to develop custom JavaScript ListBox control. Although it is only a subset of existing HTML ListBox element, it is more user friendly than the existing one. It can be further customized for different requirements. Please let me know about bugs and/or errors & give suggestions to improve this ListBox control.
  • I have tried my best to make this user control code error free. I will most welcome suggestions for further improvement in this user control. I have tested this user control on various browsers and it works fine.
  • So, this is my approach to implement an ASP.NET slide show using the DataList. I have tried my best to keep it bug free. I will most welcome suggestions and criticism for further improvements of this user control. I have tested this user control on various browsers and it works fine.
  • As we all knows that Repeater and DataList does not have auto paging support technique like Gridview or Datagrid, but we can achieve this through PagedDataSource. By using PagedDataSource we can implement paging in Repeater or DataList. Now in our mind there is question arise what is PagedDataSource. PagedDataSource is a class which encapsulates
  • So this is my approach. I was working for a long time to create C# like event handlers for JavaScript classes and finally, I’ve done it. Please let me know of any bugs and suggestions to improve this context menu control.
  • So this is my solution. If you have some other ideas about this functionality, please share them with me.
  • I have tried my best to make this code error free. Suggestions and criticism for further improvements of this code are most welcome.
  • So this is the approach that I've adopted to solve the Hover Delay problem. Although originally I developed Hover Delay to deactivate the click event for 1 second on a GridView row, later I also used Hover Delay to deactivate Drag n Drop of GridView rows. Kindly let me know if any one has some other better or different solution.
  • In this article I will explain how to import data from EXCEL to SQL in ASP.NET . In many situations we have data in the form of excel sheet but we have the requirement to have that data in SQL SERVER DB. I have explained importing data both from Excel 97-2003 as well as Excel 2007 format.
  • The source code shows how to use Regular Expressions in C#. The code Functions written for Validation Alphabet, AlphaNumeric, Integer, Postive Integer, Floating point numbers. You just cut copy these functions and use in any program.
  • That’s all about this technique. Just download the sample application and happy CSS! I have tested this application on various browsers and it worked fine.
  • This script is cross-browser compatible and fast as it iterates elements of a specific tag inside a target element [GridView] rather than iterating in a whole form. It searches the elements of a specific type in a particular column of the target element [GridView].
  • This Article is used to insert a numeric value on the sever control(text box) This is a java script code for the the client side validation. On Page Load Event You can change the events in txtNoOfQuestion.Attributes.Add("onkeypress", "return numericOnly(this);"); like onfocus events like other according to needs.
  • I have toggled visibility of all TD elements of a GridView column in order to create an illusion of smooth dynamic effect with the help of setTimeout method through recursion. Different browsers have different effects of Expanding / Collapsing GridView Columns. In Internet Explorer 7/8, Safari, Google Chrome and Opera, it seems that columns are Exp
  • In this article, I've used the setTimeout method in order to achieve a smooth expand/collapse functionality.
  • Introduction I am going to present here a functionality that selects / deselects all checkboxes of a particular column inside a GridView control, provided the header checkbox of that column is checked or unchecked using JavaScript. This functionality also has a feature that when all checkboxes of a particular column inside the GridView are check
  • This article describes how to toggle the states of all CheckBoxes inside a particular DataGridView column.
  • This article describes how to apply client-side mouse over & mouse out effects on the GridView’s rows.