SessionId and New Window in IE

P

Patrick Paquin

Hi,

When a user of Web application makes "File - New - Window" or Ctrl+N in IE,
the user obtains 2 windows IE having the same SessionId. This generates a
problem when, in one Web form, we use a variable of session to store a
dataset. The fact that the user browses with 2 windows on the same
application and the same session can give unexpected results.

Is it possible to have Id of window which would enable to name the variable
of session with this Id and, then, have a single name by opened window with
the same SessionId?

Thank you
 
M

Matt Dockerty

Is the problem with syncronous writes to the dataset? If so you could write
'lock(Session) { ... }' for c# or 'SyncLock Session ... End SyncLock' for VB
around the code that does the writes.
 
P

Patrick Paquin

No, It doesn't this. I use dataset to do the all the operations that can
require reload page, and finally save the result in the database. If the
user browses in the new opened window, he can modify the value in the
dataset. And after, if the user uses the first window, the data in the
dataset can doesn't match with the state of the web form.
 
M

Matt Dockerty

Don't fully get it but I think something you could do is get a new GUID on
the first visit to the page and suffix that to the name of the session
variable. Would that help? (haven't tested this)...

if(!this.IsPostBack) {
string suffix = Guid.NewGuid().ToString();
ViewState.Add("Suffix", suffix);
} else {
string suffix = (string)ViewState["Suffix"];
}
DataSet userDataSet = (DataSet)Session["UserDataSet" + suffix];
 
J

Joe Fallon

I have run into this issue.
It is because Ctrl-N starts IE in the same process space.
If they start it from the desktop icon then it gets its own process.
(Firefox does not though - it always runs inthe same process.)

This issue is bigger than just session.
Your cookies are shared too - including the forms authentication ticket.

Your app should still work correctly in either window though.
Not sure why you are having unexpected results. All of the same data is
available to that user.
Now if that user logs off one screen the other should still have him logged
in.
 

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

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top