Stopping multiple browsers getting session state

Discussion in 'ASP .Net' started by jediknight, Jun 13, 2007.

  1. jediknight

    jediknight Guest

    Is it possible to programmatically stop multiple browsers from getting
    the same session state?

    The problem I have is that whenever I open a new browse using File-
    >New Window, the session state gets transferred to this new window.


    I would like to stop this from happening and redirect to the homepage.

    Thanks in advance!
    jediknight, Jun 13, 2007
    #1
    1. Advertising

  2. Unfortunately, no, as this is a property of the browser. You can set up a
    method to "sync" state, but it is generally more of a pain than it is worth.
    Technically, you can boot the second browser, but how do you determine it
    the new instance other than an old, except perhaps "second time user hits
    same page with same info". Unfortunately, all you can try to do then is
    pitch the browser.

    With JavaScript you can alter the way the browser works and stop some things
    from happening, but I am not certain that is your goal.

    Now, if this is a testing thing, open a new browser from the menu, not
    Contol + N.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA
    http://gregorybeamer.spaces.live.com
    Co-author: Microsoft Expression Web Bible (upcoming)

    ************************************************
    Think outside the box!
    ************************************************
    "jediknight" <> wrote in message
    news:...
    > Is it possible to programmatically stop multiple browsers from getting
    > the same session state?
    >
    > The problem I have is that whenever I open a new browse using File-
    >>New Window, the session state gets transferred to this new window.

    >
    > I would like to stop this from happening and redirect to the homepage.
    >
    > Thanks in advance!
    >
    Cowboy \(Gregory A. Beamer\), Jun 13, 2007
    #2
    1. Advertising

  3. Hello Cowboy (Gregory A. Beamer),

    I'd add that OP perhaps may intercepts postbacks and generate GUID for the
    each page.
    Then comparing IDs he could know whether he new window was opened, because
    the new guid will be generated

    ---
    WBR, Michael Nemtsev [.NET/C# MVP].
    My blog: http://spaces.live.com/laflour
    Team blog: http://devkids.blogspot.com/

    "The greatest danger for most of us is not that our aim is too high and we
    miss it, but that it is too low and we reach it" (c) Michelangelo

    C> Unfortunately, no, as this is a property of the browser. You can set
    C> up a method to "sync" state, but it is generally more of a pain than
    C> it is worth. Technically, you can boot the second browser, but how do
    C> you determine it the new instance other than an old, except perhaps
    C> "second time user hits same page with same info". Unfortunately, all
    C> you can try to do then is pitch the browser.
    C>
    C> With JavaScript you can alter the way the browser works and stop some
    C> things from happening, but I am not certain that is your goal.
    C>
    C> Now, if this is a testing thing, open a new browser from the menu,
    C> not Contol + N.
    C>
    C> ************************************************ Think outside the
    C> box! ************************************************ "jediknight"
    C> <> wrote in message
    C> news:...
    C>
    >> Is it possible to programmatically stop multiple browsers from
    >> getting the same session state?
    >>
    >> The problem I have is that whenever I open a new browse using File-
    >>
    >>> New Window, the session state gets transferred to this new window.
    >>>

    >> I would like to stop this from happening and redirect to the
    >> homepage.
    >>
    >> Thanks in advance!
    >>
    Michael Nemtsev, Jun 13, 2007
    #3
  4. jediknight

    bruce barker Guest

    unless the browser caches the page, then both browser instances have the
    same guid. be sure to handle this case. to the server it looks like a
    page refresh.


    this happens because new window creates a new browser instance with the
    same context, so they share the same session cookies. if cookieless, the
    session id is in the url (which they share).

    -- bruce (sqlwork.com)

    Michael Nemtsev wrote:
    > Hello Cowboy (Gregory A. Beamer),
    >
    > I'd add that OP perhaps may intercepts postbacks and generate GUID for
    > the each page.
    > Then comparing IDs he could know whether he new window was opened,
    > because the new guid will be generated
    >
    > ---
    > WBR, Michael Nemtsev [.NET/C# MVP]. My blog:
    > http://spaces.live.com/laflour
    > Team blog: http://devkids.blogspot.com/
    >
    > "The greatest danger for most of us is not that our aim is too high and
    > we miss it, but that it is too low and we reach it" (c) Michelangelo
    >
    > C> Unfortunately, no, as this is a property of the browser. You can set
    > C> up a method to "sync" state, but it is generally more of a pain than
    > C> it is worth. Technically, you can boot the second browser, but how do
    > C> you determine it the new instance other than an old, except perhaps
    > C> "second time user hits same page with same info". Unfortunately, all
    > C> you can try to do then is pitch the browser.
    > C> C> With JavaScript you can alter the way the browser works and stop some
    > C> things from happening, but I am not certain that is your goal.
    > C> C> Now, if this is a testing thing, open a new browser from the menu,
    > C> not Contol + N.
    > C> C> ************************************************ Think outside the
    > C> box! ************************************************ "jediknight"
    > C> <> wrote in message
    > C> news:...
    > C>
    >>> Is it possible to programmatically stop multiple browsers from
    >>> getting the same session state?
    >>>
    >>> The problem I have is that whenever I open a new browse using File-
    >>>
    >>>> New Window, the session state gets transferred to this new window.
    >>>>
    >>> I would like to stop this from happening and redirect to the
    >>> homepage.
    >>>
    >>> Thanks in advance!
    >>>

    >
    >
    bruce barker, Jun 13, 2007
    #4
  5. jediknight wrote:
    > Is it possible to programmatically stop multiple browsers from getting
    > the same session state?
    >
    > The problem I have is that whenever I open a new browse using File-
    >> New Window, the session state gets transferred to this new window.

    >
    > I would like to stop this from happening and redirect to the homepage.
    >
    > Thanks in advance!
    >


    You can't stop that from happening. All windows in the same browser
    instance belong to the same session.

    Also, all browsers doesn't even use separate browser instances. If you
    start a new instance of the FireFox program, for example, it will
    instead open a new window in the existing instance.

    If you want any information to be page specific rather than session
    specific, you have to send the information within the page itself.

    --
    Göran Andersson
    _____
    http://www.guffa.com
    =?ISO-8859-1?Q?G=F6ran_Andersson?=, Jun 13, 2007
    #5
  6. Hello Bruce,

    BB> to the server it looks like a page refresh.

    Exactly. so it helps to prevent the refreshed, afaik

    ---
    WBR, Michael Nemtsev [.NET/C# MVP].
    My blog: http://spaces.live.com/laflour
    Team blog: http://devkids.blogspot.com/

    "The greatest danger for most of us is not that our aim is too high and we
    miss it, but that it is too low and we reach it" (c) Michelangelo
    Michael Nemtsev, Jun 14, 2007
    #6
    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. shamanthakamani
    Replies:
    1
    Views:
    3,490
    Natty Gur
    Nov 20, 2003
  2. Not Liking Dot Net Today
    Replies:
    0
    Views:
    609
    Not Liking Dot Net Today
    Apr 21, 2004
  3. Maciek
    Replies:
    0
    Views:
    8,246
    Maciek
    Sep 15, 2005
  4. jnickfl1
    Replies:
    0
    Views:
    584
    jnickfl1
    Sep 18, 2006
  5. Max2006
    Replies:
    4
    Views:
    1,731
    Vince Xu [MSFT]
    Dec 1, 2009
Loading...

Share This Page