We built all our sites with profile used for storing variables. Lately, we realized that if a user opened two different browsers, a change of a profile variable in one browser would also affect the other browser session. This could result in really odd behavior
(like changing an ID in one browser's profile value and saving info for that ID in the other browser, altering the wrong record).
So, we decided that we should change the profile values to Session variables so that the two browser 'Sessions' don't interact. Lo and behold, we found that the Session variables are also shared in the two different browser sessions. This was quite a discouraging
surprise.
We have scoured the web (and a couple threads here, too) and have not found a good easy solution to this problem. Good and easy would be something like putting a line in the web.config file to keep the sessions separate. Not good are hacking the registry
or options that require mods on every users machine.
brad75552
Member
166 Points
46 Posts
Session vs Profile
Feb 26, 2013 07:13 PM|LINK
We built all our sites with profile used for storing variables. Lately, we realized that if a user opened two different browsers, a change of a profile variable in one browser would also affect the other browser session. This could result in really odd behavior (like changing an ID in one browser's profile value and saving info for that ID in the other browser, altering the wrong record).
So, we decided that we should change the profile values to Session variables so that the two browser 'Sessions' don't interact. Lo and behold, we found that the Session variables are also shared in the two different browser sessions. This was quite a discouraging surprise.
We have scoured the web (and a couple threads here, too) and have not found a good easy solution to this problem. Good and easy would be something like putting a line in the web.config file to keep the sessions separate. Not good are hacking the registry or options that require mods on every users machine.
Anyone out there have a good solution?
Thanks.
BrockAllen
All-Star
27438 Points
4893 Posts
MVP
Re: Session vs Profile
Feb 26, 2013 07:31 PM|LINK
Move the state to the client with sessionStorage:
https://developer.mozilla.org/en-US/docs/DOM/Storage
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/