473,386 Members | 1,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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
Nov 19 '05 #1
6 2815
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
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


Nov 19 '05 #2
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
Nov 19 '05 #3
> 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

Nov 19 '05 #4
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
Nov 19 '05 #5
Hmm, this doesn't help me to understand why bringing up a second page (with
the same session) causes problems.

-Brock
DevelopMentor
http://staff.develop.com/ballen
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


Nov 19 '05 #6
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
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:40**********************@msnews.microsoft.com ...
Hmm, this doesn't help me to understand why bringing up a second page
(with the same session) causes problems.

-Brock
DevelopMentor
http://staff.develop.com/ballen
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


Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Darrin J Olson | last post by:
I am trying to end a session for a site without having to completely close the browser to end it. When I access the site and log in it works fine. If I log out and in with a different account...
4
by: Rahul Chatterjee | last post by:
Hello All I have 2 websites both using different style sheets (.css). The stylesheets are stored in a session variable and get set at the time the site gets invoked. What is happening is...
3
by: headware | last post by:
I have an issue that I've been encountering in an ASP application I'm working on. Most of the application is written in ASP, but there is one page written in ASP.NET. The ASP.NET page needs to have...
4
by: Jay | last post by:
Hello, Is it possible to have session management differentiate within browsers on one pc? For example, if you have two browsers on the same shopping site, and one browser adds to the cart, the...
7
by: Mike | last post by:
Hi, I am developing an application with framesets (header, left navigation, and content). Each frameset loads an ".aspx" page, and in one of these pages, I store some information in the Session...
13
by: Simon Matthews | last post by:
I am having issues with the right way to architecture the following (using c# asp.net):- The question I have is how best pass the collected data from one web page for use in another. The...
9
by: McGeeky | last post by:
Is there a way to get a user control to remember its state across pages? I have a standard page layout I use with a header and footer as user controls. Each page uses the same layout by means of...
8
by: KMZ_state | last post by:
We have a question here where a developer says that if the same user starts 2 instances of the application on his machine, the session variables may get mixed up b/c the session is PER IP ADDRESS. ...
18
by: BillE | last post by:
When a user opens a new IE browser window using File-New-Window the integrity of an application which relies on session state is COMPLETELY undermined. Anyone who overlooks the fact that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.