Maintain session over browsers

Discussion in 'ASP .Net' started by Tarun Mistry, Sep 25, 2006.

  1. Tarun Mistry

    Tarun Mistry Guest

    Hi everyone,

    thought my current testing, it seems a new session is opened for a user per
    browser window. I would like my sessions to track based on the machine, i.e.
    once per machine.

    What would I need todo to enable this functionality?

    Kind regards everyone
    Taz
    Tarun Mistry, Sep 25, 2006
    #1
    1. Advertising

  2. As far as I know, you would have to roll your own session state.

    "Tarun Mistry" <> wrote in message
    news:uIX$...
    > Hi everyone,
    >
    > thought my current testing, it seems a new session is opened for a user
    > per browser window. I would like my sessions to track based on the
    > machine, i.e. once per machine.
    >
    > What would I need todo to enable this functionality?
    >
    > Kind regards everyone
    > Taz
    >
    Marina Levit [MVP], Sep 25, 2006
    #2
    1. Advertising

  3. you would need some way to identify the machine. if you are on a local lan
    and no proxy is used, you could tie your sessions to the ipaddress, rather
    an a browser cookie. if its an internet/extranet app you will need an
    active/x control to get a machine id.

    -- bruce (sqlwork.com)

    "Tarun Mistry" <> wrote in message
    news:uIX$...
    > Hi everyone,
    >
    > thought my current testing, it seems a new session is opened for a user
    > per browser window. I would like my sessions to track based on the
    > machine, i.e. once per machine.
    >
    > What would I need todo to enable this functionality?
    >
    > Kind regards everyone
    > Taz
    >
    bruce barker \(sqlwork.com\), Sep 25, 2006
    #3
  4. Tarun Mistry

    Tarun Mistry Guest

    Hi guys,

    thanks for the replies.

    I'm unsure if im doing something wrong here, however I come from a PHP
    background, here, PHP only writes 1 session per hostname/ipaddress.

    In a php application, if I open 3 browsers pointing to a page session.php,
    they will all contain reference to the same session. However if I open 3
    browsers to session.aspx, they will all contain 3 different sessions. I am
    trying to get functionality that is similar to PHP, is this possible? Should
    I be looking at directly manipulating the cookie instead?

    Thanks everyone.
    Taz
    Tarun Mistry, Sep 25, 2006
    #4
  5. Tarun Mistry

    Patrice Guest

    You could try a cookieless session.

    By default ASP/ASP.NET uses a temporary cookie to handle session. The
    behavior for windows used opened explicittely by the user is client side
    depended (i.e. depends wether cookies are shared or not between those
    windows).

    A cookieless session (enabled in web.config) would likely allow to overcome
    this problem (as the URL includes the information needed to establish the
    session). A custom provider could also be a possible solution.

    The exact scenario may help (you could have perhaps some other solution that
    opening 3 browsers to point to these pages ?). For example when someone
    needs to connect multiple times to the same application, I would see if it
    could be built in in to the application (for application as in a mail
    application that allows to have a mail box managed by those you'll add in an
    access list).
    --
    Patrice

    "Tarun Mistry" <> a écrit dans le message de news:
    %...
    > Hi guys,
    >
    > thanks for the replies.
    >
    > I'm unsure if im doing something wrong here, however I come from a PHP
    > background, here, PHP only writes 1 session per hostname/ipaddress.
    >
    > In a php application, if I open 3 browsers pointing to a page session.php,
    > they will all contain reference to the same session. However if I open 3
    > browsers to session.aspx, they will all contain 3 different sessions. I am
    > trying to get functionality that is similar to PHP, is this possible?
    > Should I be looking at directly manipulating the cookie instead?
    >
    > Thanks everyone.
    > Taz
    >
    Patrice, Sep 25, 2006
    #5
  6. Sessions are opened per browser instances, and they are completely separate.
    If you are using ASP.NET 2.0, you can use Profile Services Feature instead.
    and if you are not storing objects, you can use cookies
    --
    Muhammad Mosa
    Software Engineer & Solution Developer
    MCT/MCSD.NET
    MCTS: .Net 2.0 Web Applications
    MCTS: .Net 2.0 Windows Applications


    "Tarun Mistry" wrote:

    > Hi everyone,
    >
    > thought my current testing, it seems a new session is opened for a user per
    > browser window. I would like my sessions to track based on the machine, i.e.
    > once per machine.
    >
    > What would I need todo to enable this functionality?
    >
    > Kind regards everyone
    > Taz
    >
    >
    >
    =?Utf-8?B?TXVoYW1tYWQgTW9zYQ==?=, Sep 26, 2006
    #6
  7. Tarun Mistry

    Hans Kesting Guest

    > Hi everyone,
    >
    > thought my current testing, it seems a new session is opened for a user per
    > browser window. I would like my sessions to track based on the machine, i.e.
    > once per machine.
    >
    > What would I need todo to enable this functionality?
    >
    > Kind regards everyone
    > Taz


    If you open a new IE window with Ctrl-N (or File|New|Window), then the
    windows will share the cookies and therefore the sessions.
    If you open a new IE window by clicking the "e" in the quicklaunch
    panel, then it is a separate instance with a different set of cookies
    (and thus sessions).
    How FireFox or other browsers react in this case, I don't know.

    Hans Kesting
    Hans Kesting, Sep 26, 2006
    #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. Satish Appasani

    Maintain an uploaded Image in a Session

    Satish Appasani, Jul 18, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    372
    Satish Appasani
    Jul 18, 2003
  2. Oscar Onorato

    How To maintain Session state without cookies

    Oscar Onorato, Nov 5, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    855
    Oscar Onorato
    Nov 5, 2004
  3. David Berman
    Replies:
    2
    Views:
    4,673
    David Berman
    Feb 3, 2005
  4. El Kabong

    Browsers, browsers! Quo vadis?

    El Kabong, May 11, 2007, in forum: HTML
    Replies:
    23
    Views:
    863
    dorayme
    May 13, 2007
  5. Max2006
    Replies:
    4
    Views:
    1,717
    Vince Xu [MSFT]
    Dec 1, 2009
Loading...

Share This Page