Answered by:
Multiple tabs in IE and session variables

Question
-
Hi All,
We currently have a SharePoint site that uses custom WebParts for various tasks. There is one webpart that is available in used in all the site pages and works based on a session variable "Customer". The customer session variable is picked up by the webpart in each page . There are a couple of event receivers and also custom list forms that use this session variable to update or fetch information.
The users use Mutiple Tabs in Internet Explorer and would like to see different customer information in each tabs. Due to the use of session variables, it cannot handle different values in different tabls.
Now, that leaves us with 2 problems
1) The session value should not be used across tabs
2) The value stored in a particular tab must be made available to event receivers and other custom list forms that are activated from a specific tab.
We use SharePoint Top Navigation and using custom navigation is not an option. So, passing query string values across pages is not an option. We have looked at ViewState object but that doesn't serve the purpose as we will not be able to pass values across pages.
Any ideas? Much appreciated.
Regards,
Saikrupa
Sai
Wednesday, June 27, 2012 1:54 PM
Answers
-
Hi Saikrupa,
Session is persistent across single browser, ViewState is for single page, you may consider using them based on your requirement, from your description, I understand that you use a variable in a web part that may be existing across pages, and you want to also use this variable based on single page scenario, it seems more than Session or ViewState can achieve. You seems to want to filter data based on specific information, if so, you may need to store the specific data in site, not in session.
Thanks,
Qiao Wei
TechNet Community Support
- Proposed as answer by Shruti Raturi Thursday, June 28, 2012 7:55 AM
- Marked as answer by Qiao Wei Thursday, July 5, 2012 10:23 AM
Thursday, June 28, 2012 7:52 AM -
All Tab in the same browser Type will share the session, so its not possible to achieve it from Session Variables.....
The requirement is not at par with Good Standard coding practices.
If still they want something like this, you will have to store and fetch data from SPList/DB which is not advisable.
Hope this helps....
Regards,
Success is a slow rider, it requires a lot of time, I need pace in life, so left success and moved ahead.
- Marked as answer by Qiao Wei Thursday, July 5, 2012 10:23 AM
Thursday, June 28, 2012 8:26 AM
All replies
-
Hi Saikrupa,
Session is persistent across single browser, ViewState is for single page, you may consider using them based on your requirement, from your description, I understand that you use a variable in a web part that may be existing across pages, and you want to also use this variable based on single page scenario, it seems more than Session or ViewState can achieve. You seems to want to filter data based on specific information, if so, you may need to store the specific data in site, not in session.
Thanks,
Qiao Wei
TechNet Community Support
- Proposed as answer by Shruti Raturi Thursday, June 28, 2012 7:55 AM
- Marked as answer by Qiao Wei Thursday, July 5, 2012 10:23 AM
Thursday, June 28, 2012 7:52 AM -
All Tab in the same browser Type will share the session, so its not possible to achieve it from Session Variables.....
The requirement is not at par with Good Standard coding practices.
If still they want something like this, you will have to store and fetch data from SPList/DB which is not advisable.
Hope this helps....
Regards,
Success is a slow rider, it requires a lot of time, I need pace in life, so left success and moved ahead.
- Marked as answer by Qiao Wei Thursday, July 5, 2012 10:23 AM
Thursday, June 28, 2012 8:26 AM -
Sorry, but you are incorrect for IE8/9. In these environments, session state is persisted across not only all tabs in one browser session, but across ALL browser sessions. This has created a huge nightmare for our group.
Tuesday, August 28, 2012 7:29 PM -
Sorry to you also, but your reply is ludicrous. How can you determine best coding practices without knowing the business problem? Then you suggest using a DB to maintain state. Just how can you do this with the same application vying for the same server variable names from the same DB and still maintain uniqueness between session?
Our users do the exact same thing on a daily basis as that is how they work, by have multiple sessions of the same application running at the same time in multiple browser sessions. Prior to IE8/9, we were able to isolate each application instance in it's own browser session, which segregated the session variables. Now that IE8/9 has made ALL session variables available across ALL browser sessions, our users are no longer able work as effectively. So much from advice from the ivory tower!!!!
Tuesday, August 28, 2012 7:33 PM