I've recently been developing a website using asp.net webforms that uses in proc sessions and I noticed that session ids are shared amongst browser tabs. So I was wondering what you would do for the following situation
Problem:
In my application I have a requirement where the user is allowed to select a competition via dropdown list. Initially I stored this selection in a session. But I soon found out that a person would open up competition 1 in browser tab 1 and competition 2 in browser tab 2. Once again the session would get overwritten.
- User opens browser tab 1 with competition1 - store in session
- User navigates to buy something in competition 1 page
- User opens browser tab 2 with competition2 - store in session
- User returns to browser tab 1 and is about to buy something suddenly it's trying to save the information with competition 2 info
How do I make sure the competitions stay independent and persist in each tab?
So I thought after a selection is made I would use a querystring and append the competition id to the url, www.foo.com/page1.aspx?comp=1 I would probably also encrypt the competition id.
But in doing so, I have to make sure that every link in my website get's the competition Id appended to the url.
Question:
- Could I do the appending of the url querystring dynamically via a httpmodule that looks at internal links and appends the current url compID onto them?
- Would url rewriting help somehow?
Any help would be greatly appreciated