Session data overwritten when using two browser instances (CTR+N)

  • Thread starter Arnt O. Kvannefoss
  • Start date
A

Arnt O. Kvannefoss

Hello,
We have an asp.net application to manage events. Some users get their
session values overwritten because they open a second instance of their
browser with File > New > Window. These two instances will now share the
session values. When they move to another event in the second instance this
event's data will be overwritten when they update data for the event in the
first instance. How can we code around this problem?

Best regards
Software Consult AS
Microsoft Certified Partner
Arnt Kvannefoss
 
B

Brock Allen

You need to code for the possibility that this could happen. I don't know
what kind of data you're storing, but you shouldn't make the assumptions
you're currently making. What sorts of things does your page do and what
is being stored in Session?

The other option is a quick fix which would be to disallow the user to access
the page if they're already mid-sequence in another browser. Again, this
is a way to code defensively for this contingency.

-Brock
DevelopMentor
http://staff.develop.com/ballen
 
A

Arnt O. Kvannefoss

To clarify our issue see the following answer I got in another newsgroup.
There have to be a solution to this serious problem. Microsoft, please
respond.

You can't, really. What's happening is that the user now has two browser
instances running in a single process. From the perspective of the server,
there is no way to tell whether the user has a single window open, or two,
or ten. Now, there are some hacks that I can think of that *might* allow
you to work around this, but the bottom-line is, you can't ever do more than
make an educated guess about what's happening at the client. Without
knowing more about your situation, I can' t really suggest alternatives, but
you may want to protect the "events" by requring that, say, an event id
variable that's in a posted form match with an event id variable that's in
session, or use some other type of verification to positively match
apples-to-apples before you make updates or changes, or use session data in
ways that may not be appropriate.

Best regards
Software Consult AS
Microsoft Certified Partner
Arnt Kvannefoss
 
B

Brock Allen

To clarify our issue see the following answer I got in another
newsgroup. There have to be a solution to this serious problem.
Microsoft, please respond.

It's not Microsoft's fault for this. It's the nature of browser based technologies.

Can you ellaborate on what type of data you're storing in Session and how
your pages work with it? If you don't provide this info, then it's going
to be hard to help devise a solution.

-Brock
DevelopMentor
http://staff.develop.com/ballen
 
A

Arnt O. Kvannefoss

We store e.g. vital info as eventid and clubid in the session and use
session to transfer this data between pages.

Best regards
Software Consult AS
Microsoft Certified Partner
Arnt Kvannefoss
 
A

Arnt O. Kvannefoss

The culprint is the way the second browser window is opened. The two windows
share session variables and when the user change event in browser window no
2, the session variables is changed also for browser window no 1. The user
goes back to the first window, edit and save. The new data is saved on the
wrong event.
Best regards
Software Consult AS
Microsoft Certified Partner
Arnt Kvannefoss
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top