Detect/prevent multiple tab/browser...

  • Thread starter James Hunter Ross
  • Start date
J

James Hunter Ross

Friends,

Our application has a "session" concept, and it just cannot work reliably if
more than one browser instance (two tabs, or two IE8 instances on a single
workstation) refer to the same session. Cookies are involved apparently.

Anyway, is there any good technique we can use to notice that a second tab
or browser instance is accessing our application session. Right now, at the
server side we just don't have a distinction between on tab/instance and
another if they are all from the same workstation.

I may have phrased this poorly, I'm not actually on the web development
team, (I do SQL back-end stuff), but any words or thoughts you have will be
greatly appreciated.

James
 
G

Guest

Friends,

Our application has a "session" concept, and it just cannot work reliably if
more than one browser instance (two tabs, or two IE8 instances on a single
workstation) refer to the same session.  Cookies are involved apparently.

Anyway, is there any good technique we can use to notice that a second tab
or browser instance is accessing our application session.  Right now, at the
server side we just don't have a distinction between on tab/instance and
another if they are all from the same workstation.

I may have phrased this poorly, I'm not actually on the web development
team, (I do SQL back-end stuff), but any words or thoughts you have will be
greatly appreciated.

James

James,

I found following js-approach, see
http://www.codeproject.com/KB/aspnet/MultipleTabWindows.aspx

You may also try to generate unique id by javascript and use Session
or cookies to track it. For example, at first window you will generate
id=0123456789, put it into session object (e.g. by using iframe). Then
you can always check if id is the same as in the Session or it is new.
When it's new - you can show message that only one window is allowed)

Hope this helps
 
J

Jesse Houwing

Hello James,
Friends,

Our application has a "session" concept, and it just cannot work
reliably if more than one browser instance (two tabs, or two IE8
instances on a single workstation) refer to the same session. Cookies
are involved apparently.

Anyway, is there any good technique we can use to notice that a second
tab or browser instance is accessing our application session. Right
now, at the server side we just don't have a distinction between on
tab/instance and another if they are all from the same workstation.

I may have phrased this poorly, I'm not actually on the web
development team, (I do SQL back-end stuff), but any words or thoughts
you have will be greatly appreciated.

It's usually better to code with multiple windows in mind (it isn't actually
that hard), but you run into problems once in a while (especially if multiple
windows weren't part of the scope, or the developers just disn't know about
it).

As a user I want to be able to use multiple tabs/windows. Your users might
also want to use them (seeing that you'rerunning into problems, my guess
is they're already using this feature). For future applications, make sure
this is a supported feature. By makign sure you're using a workflow per use
case (like windows workflow) to restrict page transitions and to keep the
current position, you can effectively support multiple workflows on the same
client. Within each workflow you'd do additional checking to make sure the
postback that is occuring is valid for the current position in the workflow.
If it isn't just notify the user and offer him 2 choices, one, go back and
start a new workflow with the same settings (if applicatble), two, jump to
the current position in the workflow you were posting back to and contuniue
from there (if the workflow is still active).

You can assign each workflow a unique id and store that ID in the viewstate
of your page. If needed you can pass the workflow id as a url parameter for
link based navigation. Store each workflow in the session based on this unique
id and you're all set.
 
J

Jeff Maus

James,

If you ever find a solution to this, I would appreciate you forwarding the solution, as we are also stuck w/ the same issue.

Regards,

Jeff



Posted as a reply to:

Detect/prevent multiple tab/browser...
03-Jun-09

Friends,

Our application has a "session" concept, and it just cannot work reliably if
more than one browser instance (two tabs, or two IE8 instances on a single
workstation) refer to the same session. Cookies are involved apparently.

Anyway, is there any good technique we can use to notice that a second tab
or browser instance is accessing our application session. Right now, at the
server side we just don't have a distinction between on tab/instance and
another if they are all from the same workstation.

I may have phrased this poorly, I'm not actually on the web development
team, (I do SQL back-end stuff), but any words or thoughts you have will be
greatly appreciated.

James

EggHeadCafe - Software Developer Portal of Choice
WPF And The Model View View Model Pattern
http://www.eggheadcafe.com/tutorial...b-7374d3da3425/wpf-and-the-model-view-vi.aspx
 
P

Patrice

Not sure what is the problem but the user will always be able to use
multiple browser instance (though I've seen a script recently to detect
multiple tabs in a single browser instance, If I remember it just browses a
frame or window collections).

My personal preference would be to double check the problem it causes and
try to solve this rather than just trying to forbid the user to do this
(AFAIK it will be always possible in edge cases).



"Jeff Maus" a écrit dans le message de groupe de discussion :
(e-mail address removed)...
 
P

Patrice

Not sure what is the problem but the user will always be able to use
multiple browser instance (though I've seen a script recently to detect
multiple tabs in a single browser instance, If I remember it just browses
a frame or window collections).

So it was :
http://groups.google.com/group/micr...c9d8f364478fc/197c63cbbc31d015?lnk=raot&pli=1

It points to :
http://www.codeproject.com/KB/aspnet/MultipleTabWindows.aspx

I must have confused with something else as this is not possible client side
(and makes senses as then my site could know what are the other sites you
opened so it would be a privacy issue).
 

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,954
Messages
2,570,116
Members
46,704
Latest member
BernadineF

Latest Threads

Top