How to get a sessionid asp.net 2.0

Discussion in 'ASP .Net' started by KMG, Jan 8, 2007.

  1. KMG

    KMG Guest

    How do I get a sessionid? I have tried:
    Dim mySession as HTTPSessionState
    Dim sSessionID as String
    mySessionID = nothing
    sSessionID = nothing
    sSessionID = mySessionID.SessionID

    and I get the error "Object reference not set to an instance of an object."

    When I add the "new" -- Dim mySession as New HTTPSessionState -- I get the
    error that HTTPSessionState has no constructors

    If I simply try
    Dim sSessionID as String = System.Web.SessionState.HttpSessionState...,
    there is no property for SessionID



    Thank you for your help.
     
    KMG, Jan 8, 2007
    #1
    1. Advertising

  2. KMG

    Mark Rae Guest

    "KMG" <> wrote in message
    news:...

    > sSessionID = mySessionID.SessionID


    sSessionID = HttpContext.Current.Session.SessionID
     
    Mark Rae, Jan 8, 2007
    #2
    1. Advertising

  3. KMG

    KMG Guest

    Thanks!

    "Mark Rae" <> wrote in message
    news:%...
    > "KMG" <> wrote in message
    > news:...
    >
    >> sSessionID = mySessionID.SessionID

    >
    > sSessionID = HttpContext.Current.Session.SessionID
    >
     
    KMG, Jan 8, 2007
    #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. alien2_51

    Re: Debugging -- SessionID and ASP.Net

    alien2_51, Jul 24, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    496
    Rob Teixeira [MVP]
    Jul 24, 2003
  2. CQL
    Replies:
    2
    Views:
    2,158
    Colin Young
    Aug 11, 2003
  3. Ronald
    Replies:
    6
    Views:
    6,961
    Andy Mortimer [MS]
    Feb 23, 2004
  4. Rob Meade

    ASP.Net [2.0] - SessionID

    Rob Meade, May 13, 2006, in forum: ASP .Net
    Replies:
    7
    Views:
    7,132
    Yanis
    Sep 25, 2008
  5. Replies:
    2
    Views:
    147
    Daniel Crichton
    Jul 3, 2007
Loading...

Share This Page