Detect/prevent multiple tab/browser...

Discussion in 'ASP .Net' started by James Hunter Ross, Jun 4, 2009.

  1. 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 Hunter Ross, Jun 4, 2009
    #1
    1. Advertising

  2. On Jun 4, 1:36 am, "James Hunter Ross" <>
    wrote:
    > 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
     
    Alexey Smirnov, Jun 4, 2009
    #2
    1. Advertising

  3. 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.
    --
    Jesse Houwing
    jesse.houwing at sogeti.nl
     
    Jesse Houwing, Jun 4, 2009
    #3
  4. Thank you...

    ....you guys are great, thanks so much.

    James
     
    James Hunter Ross, Jun 4, 2009
    #4
  5. James Hunter Ross

    Jeff Maus Guest

    Detect/prevent multiple tab/browser instances

    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
     
    Jeff Maus, Sep 22, 2009
    #5
  6. James Hunter Ross

    Patrice Guest

    Re: Detect/prevent multiple tab/browser instances

    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 :
    ...
    > 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
     
    Patrice, Sep 22, 2009
    #6
  7. James Hunter Ross

    Patrice Guest

    Re: Detect/prevent multiple tab/browser instances

    > 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).

    --
    Patrice
     
    Patrice, Sep 22, 2009
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hermit Dave
    Replies:
    0
    Views:
    440
    Hermit Dave
    Jan 22, 2004
  2. News Sympatico
    Replies:
    0
    Views:
    311
    News Sympatico
    May 21, 2005
  3. Replies:
    4
    Views:
    717
  4. Otis Mukinfus
    Replies:
    2
    Views:
    616
    Otis Mukinfus
    Jan 14, 2007
  5. Replies:
    0
    Views:
    502
Loading...

Share This Page