Session variable are shared between users

Discussion in 'ASP .Net' started by ton, Apr 2, 2004.

  1. ton

    ton Guest

    Hi,
    I keep several variables in a statevalue like:
    Dim session As SessionState.HttpSessionState =
    System.Web.HttpContext.Current.Session

    session("connect") = " FKHFSF "

    I thought that these variables would be the exclusive use of one connected
    user/connection. But it looks like that in a multiuser enviroment some
    variables are shared. So I end on the page somenone else was editing.

    What am I missing here. (I have not modified any property of the session
    variable)

    Ton
     
    ton, Apr 2, 2004
    #1
    1. Advertising

  2. ton

    Patrice Guest

    No other code than that ? It looks like it should work (of course all users
    will have the same connect value if you store always FKHFSF for all users).
    What if you are using directly System.Web.HttpContext.Current.Session.

    Other than that , it would like as if you were using a shared property
    somewhere...

    Patrice


    "ton" <> a écrit dans le message de
    news:c4jor3$68l$1.nb.home.nl...
    > Hi,
    > I keep several variables in a statevalue like:
    > Dim session As SessionState.HttpSessionState =
    > System.Web.HttpContext.Current.Session
    >
    > session("connect") = " FKHFSF "
    >
    > I thought that these variables would be the exclusive use of one connected
    > user/connection. But it looks like that in a multiuser enviroment some
    > variables are shared. So I end on the page somenone else was editing.
    >
    > What am I missing here. (I have not modified any property of the session
    > variable)
    >
    > Ton
    >
    >
     
    Patrice, Apr 2, 2004
    #2
    1. Advertising

  3. ton

    ton Guest

    No other code than that ! I save the logged in user, the page where I, the
    details, the recordID of the record they asked.

    but when 2 users connect via internet with my page, the values get mixed up.
    I have to say that I've developed a Customserver control and that is using
    the state variable

    Ton


    "Patrice" <> schreef in bericht
    news:...
    > No other code than that ? It looks like it should work (of course all

    users
    > will have the same connect value if you store always FKHFSF for all

    users).
    > What if you are using directly System.Web.HttpContext.Current.Session.
    >
    > Other than that , it would like as if you were using a shared property
    > somewhere...
    >
    > Patrice
    >
    >
    > "ton" <> a écrit dans le message de
    > news:c4jor3$68l$1.nb.home.nl...
    > > Hi,
    > > I keep several variables in a statevalue like:
    > > Dim session As SessionState.HttpSessionState =
    > > System.Web.HttpContext.Current.Session
    > >
    > > session("connect") = " FKHFSF "
    > >
    > > I thought that these variables would be the exclusive use of one

    connected
    > > user/connection. But it looks like that in a multiuser enviroment some
    > > variables are shared. So I end on the page somenone else was editing.
    > >
    > > What am I missing here. (I have not modified any property of the session
    > > variable)
    > >
    > > Ton
    > >
    > >

    >
    >
     
    ton, Apr 2, 2004
    #3
  4. ton

    ton Guest

    No other code than that ! I save the logged in user, the page where I, the
    details, the recordID of the record they asked.

    but when 2 users connect via internet with my page, the values get mixed up.
    I have to say that I've developed a Customserver control and that is using
    the state variable

    Ton


    "Patrice" <> schreef in bericht
    news:...
    > No other code than that ? It looks like it should work (of course all

    users
    > will have the same connect value if you store always FKHFSF for all

    users).
    > What if you are using directly System.Web.HttpContext.Current.Session.
    >
    > Other than that , it would like as if you were using a shared property
    > somewhere...
    >
    > Patrice
    >
    >
    > "ton" <> a écrit dans le message de
    > news:c4jor3$68l$1.nb.home.nl...
    > > Hi,
    > > I keep several variables in a statevalue like:
    > > Dim session As SessionState.HttpSessionState =
    > > System.Web.HttpContext.Current.Session
    > >
    > > session("connect") = " FKHFSF "
    > >
    > > I thought that these variables would be the exclusive use of one

    connected
    > > user/connection. But it looks like that in a multiuser enviroment some
    > > variables are shared. So I end on the page somenone else was editing.
    > >
    > > What am I missing here. (I have not modified any property of the session
    > > variable)
    > >
    > > Ton
    > >
    > >

    >
    >
     
    ton, Apr 2, 2004
    #4
  5. Ho do you test the multi-user environment?
    Do you just open up the second browser?
    If you opening it by using new window then you get the same session.
    It's by design (of Browser).

    Try to do the real test. From 2 different machines for example.

    I can assure you that it works (unless your system is messed up big time)

    George.

    "ton" <> wrote in message
    news:c4jor3$68l$1.nb.home.nl...
    > Hi,
    > I keep several variables in a statevalue like:
    > Dim session As SessionState.HttpSessionState =
    > System.Web.HttpContext.Current.Session
    >
    > session("connect") = " FKHFSF "
    >
    > I thought that these variables would be the exclusive use of one connected
    > user/connection. But it looks like that in a multiuser enviroment some
    > variables are shared. So I end on the page somenone else was editing.
    >
    > What am I missing here. (I have not modified any property of the session
    > variable)
    >
    > Ton
    >
    >
     
    George Ter-Saakov, Apr 5, 2004
    #5
  6. ton

    ton Guest

    it does not work on a second system.
    But I've solved it allready. It looks that using sessionstate variables in a
    customserver control is not reliable.
    I've changed it to viewstate and now it works. Allthough I have to save de
    logon values in a sessionstate, then when opening the second page (with
    another customservercontrol) I read the sessionstate variable and save them
    in viewstate. With these variabele I keep on using without any problem when
    other users are opening the same page.

    ton


    "George Ter-Saakov" <> schreef in bericht
    news:...
    > Ho do you test the multi-user environment?
    > Do you just open up the second browser?
    > If you opening it by using new window then you get the same session.
    > It's by design (of Browser).
    >
    > Try to do the real test. From 2 different machines for example.
    >
    > I can assure you that it works (unless your system is messed up big time)
    >
    > George.
    >
    > "ton" <> wrote in message
    > news:c4jor3$68l$1.nb.home.nl...
    > > Hi,
    > > I keep several variables in a statevalue like:
    > > Dim session As SessionState.HttpSessionState =
    > > System.Web.HttpContext.Current.Session
    > >
    > > session("connect") = " FKHFSF "
    > >
    > > I thought that these variables would be the exclusive use of one

    connected
    > > user/connection. But it looks like that in a multiuser enviroment some
    > > variables are shared. So I end on the page somenone else was editing.
    > >
    > > What am I missing here. (I have not modified any property of the session
    > > variable)
    > >
    > > Ton
    > >
    > >

    >
    >
     
    ton, Apr 5, 2004
    #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. John Kraft

    Shared Variable Vs. Session Variable

    John Kraft, Oct 21, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    1,889
    Cowboy \(Gregory A. Beamer\)
    Oct 21, 2003
  2. Philip Tepedino
    Replies:
    3
    Views:
    4,157
  3. ben
    Replies:
    3
    Views:
    516
    Kevin Spencer
    Nov 15, 2004
  4. Replies:
    1
    Views:
    1,288
    santosh
    Jul 15, 2008
  5. Jazzis
    Replies:
    2
    Views:
    257
    Jazzis
    Sep 23, 2003
Loading...

Share This Page