Using a db to share ASP session state var w/ ASP.NET page

Discussion in 'ASP .Net' started by VB Programmer, Jun 8, 2004.

  1. I've read that you can save a session state variable created by an ASP page
    into a db so that the value of the session state variable can be read/used
    by an ASP.NET webform.

    Question: Let's say the session variable is called "UserIsAdmin" and the
    ASP page is the login page. When the person logs in as 'admin' it stores
    the session variable as "True" in a db. How does the ASP.NET page that is
    served up know whether the page requestor is the same user or a different
    user? If "UserIsAdmin" is set to True in the db, won't anyone be able to
    get in as 'admin' because this db value has been set? Am I missing
    something?
     
    VB Programmer, Jun 8, 2004
    #1
    1. Advertising

  2. VB Programmer

    Raterus Guest

    I think you are missing the fact you can't do it :)
    Now a db can share data between the two, but you aren't going to set/get it through the session object, you'll have to create your own object for that. Also, like you're stuck on, you'll need to set some indentifying information in the querystring/cookies to know who is who between platforms.

    "VB Programmer" <> wrote in message news:%235i$...
    > I've read that you can save a session state variable created by an ASP page
    > into a db so that the value of the session state variable can be read/used
    > by an ASP.NET webform.
    >
    > Question: Let's say the session variable is called "UserIsAdmin" and the
    > ASP page is the login page. When the person logs in as 'admin' it stores
    > the session variable as "True" in a db. How does the ASP.NET page that is
    > served up know whether the page requestor is the same user or a different
    > user? If "UserIsAdmin" is set to True in the db, won't anyone be able to
    > get in as 'admin' because this db value has been set? Am I missing
    > something?
    >
    >
     
    Raterus, Jun 8, 2004
    #2
    1. Advertising

  3. Thanks Raterus. I'll search online for some examples.
    "Raterus" <> wrote in message
    news:%...
    I think you are missing the fact you can't do it :)
    Now a db can share data between the two, but you aren't going to set/get it
    through the session object, you'll have to create your own object for that.
    Also, like you're stuck on, you'll need to set some indentifying information
    in the querystring/cookies to know who is who between platforms.

    "VB Programmer" <> wrote in message
    news:%235i$...
    > I've read that you can save a session state variable created by an ASP

    page
    > into a db so that the value of the session state variable can be read/used
    > by an ASP.NET webform.
    >
    > Question: Let's say the session variable is called "UserIsAdmin" and the
    > ASP page is the login page. When the person logs in as 'admin' it stores
    > the session variable as "True" in a db. How does the ASP.NET page that is
    > served up know whether the page requestor is the same user or a different
    > user? If "UserIsAdmin" is set to True in the db, won't anyone be able to
    > get in as 'admin' because this db value has been set? Am I missing
    > something?
    >
    >
     
    VB Programmer, Jun 8, 2004
    #3
    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. thomson
    Replies:
    10
    Views:
    2,503
    Eliyahu Goldin
    Jun 20, 2005
  2. thomson
    Replies:
    0
    Views:
    389
    thomson
    Jun 20, 2005
  3. jnickfl1
    Replies:
    0
    Views:
    598
    jnickfl1
    Sep 18, 2006
  4. archana
    Replies:
    0
    Views:
    352
    archana
    Mar 13, 2007
  5. Saraswati lakki
    Replies:
    0
    Views:
    1,350
    Saraswati lakki
    Jan 6, 2012
Loading...

Share This Page