PROBLEM: Browsers Sharing Session Variables

G

Godot

I have an ASP.NET 1.1 web app that stores a current record ID value in
a session variable so it can be accessed from multiple pages for
inserting/updating of related records.

Unfortunately, if the user chooses FILE/NEW/WINDOW in IE, the new
browser window has the same session ID as the original browser window.
Therefore, if the user retrieves a different record in the second
browser window, the ID in the session variable is changed to reflect
that, but the original browser window is still displaying the old
record. Because the ID value stored in the session is used for
inserts/updates of related records, the actions in one browser window
can (and did) overwrite the data from another record.

Q: Is there some way to prevent this from happening by tracking if a
second window is opened, or something, anything?

Help Mr. Wizard!
 
M

Marina

No, this is how it works, I don't believe there is a way to stop it.

To avoid your problem, don't store these things in session. Use ViewState,
hidden input controls, etc.
 
G

Godot

Marina,

Thanks for the replay. I was afraid that was the case. I had hoped
that my short-sightedness in using session variables for our current
user-level data wouldn't necessitate a rewrite, but oh well....

-- Paul
 

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

Members online

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top