Accessing a ASP (not .NET) session from ASP.NET

Discussion in 'ASP .Net' started by Soren S. Jorgensen, Jan 20, 2006.

  1. Hi,

    I've got a web-app thats activated by a call to a aspx page from ASP, I need
    to go back to the ASP session and get some simple data saved in that
    session.

    I have no possiblity to do session sharing through Sql server or file ect,
    but I think I'm able to get the ASP session ID as a parameter on the initial
    call of the aspx page (without this I guess there's no way for sure)

    Has anyone seen examples how to do this, and if so, where ??

    Soren
    Soren S. Jorgensen, Jan 20, 2006
    #1
    1. Advertising

  2. ASP and ASP.Net are 2 different applications. Each runs in its own memory
    space. As Session state in ASP (and usually in ASP.Net) is stored in memory,
    there is no way to directly access it. Therefore, the only ways to access
    Session data across these apps are via HTTP Request/Response, or by commonly
    available disk resources on the server. That is, an ASP.Net page can post or
    redirect to an ASP page, and vice versa. A form post or QueryString can
    contain the data to be passed. Alternatively, either app can write data to a
    database or file somewhere on the server, which the other app can read.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    Who is Mighty Abbott?
    A twin turret scalawag.

    "Soren S. Jorgensen" <> wrote in message
    news:%...
    > Hi,
    >
    > I've got a web-app thats activated by a call to a aspx page from ASP, I
    > need to go back to the ASP session and get some simple data saved in that
    > session.
    >
    > I have no possiblity to do session sharing through Sql server or file ect,
    > but I think I'm able to get the ASP session ID as a parameter on the
    > initial call of the aspx page (without this I guess there's no way for
    > sure)
    >
    > Has anyone seen examples how to do this, and if so, where ??
    >
    > Soren
    >
    >
    Kevin Spencer, Jan 20, 2006
    #2
    1. Advertising

  3. I'm pretty sure ASP has a COM object that you can use to access session
    state. I can't remember what its exact name is but just open the Add
    Reference dialog and search. Once you have this and the session ID you
    should be set.

    HTH,
    Kent

    "Soren S. Jorgensen" <> wrote in message
    news:%...
    > Hi,
    >
    > I've got a web-app thats activated by a call to a aspx page from ASP, I
    > need to go back to the ASP session and get some simple data saved in that
    > session.
    >
    > I have no possiblity to do session sharing through Sql server or file ect,
    > but I think I'm able to get the ASP session ID as a parameter on the
    > initial call of the aspx page (without this I guess there's no way for
    > sure)
    >
    > Has anyone seen examples how to do this, and if so, where ??
    >
    > Soren
    >
    >
    Kent Boogaart, Jan 21, 2006
    #3
  4. Soren S. Jorgensen

    Steve James Guest

    Hi,

    I've needed to do this recently.

    Create a page in the asp application that simply writes out all session
    variables to the response in the form of an Xml document (or a
    proprietary format).

    In your ASP.Net application do an HTTP GET to the asp page created
    above to retrieve the xml document. Each element in the xml doc can
    then be written to the .Net session or wherever you wish.

    Hope this helps,

    Steve
    Steve James, Jan 21, 2006
    #4
  5. Bone up on Billy Yuen's MSDN article on how to do that :

    http://msdn.microsoft.com/asp.net/r...library/en-us/dnaspp/html/converttoaspnet.asp




    Juan T. Llibre
    ASP.NET MVP
    ============
    "Soren S. Jorgensen" <> wrote in message
    news:%...
    > Hi,
    >
    > I've got a web-app thats activated by a call to a aspx page from ASP, I need to go back to the ASP
    > session and get some simple data saved in that session.
    >
    > I have no possiblity to do session sharing through Sql server or file ect, but I think I'm able to
    > get the ASP session ID as a parameter on the initial call of the aspx page (without this I guess
    > there's no way for sure)
    >
    > Has anyone seen examples how to do this, and if so, where ??
    >
    > Soren
    >
    >
    Juan T. Llibre, Jan 21, 2006
    #5
  6. Hi,

    Thanks for the replies, I finally went another way than any suggested.

    I forgot to mention that there was some security issues as well. The info I
    had to retrieve from the ASP session was prohibited from ever getting sent
    to the client. So I made a COM+ server where the info will be saved from the
    ASP session (on the server). The method storing the info will return a newly
    created Guid, and this key will be passed to the ASP.NET session as a
    parameter on the aspx page. First thing the aspx page does (on the server)
    is checking if this parameter is applied, and if it is, gets the info from
    the COM+ server (using the supplied key) and stores the info into the
    ASP.NET session - then it do a redirect back to it self (without the
    parameter).

    Kind'a like the session sharing thing...

    Soren

    "Soren S. Jorgensen" <> skrev i en meddelelse
    news:%...
    > Hi,
    >
    > I've got a web-app thats activated by a call to a aspx page from ASP, I
    > need to go back to the ASP session and get some simple data saved in that
    > session.
    >
    > I have no possiblity to do session sharing through Sql server or file ect,
    > but I think I'm able to get the ASP session ID as a parameter on the
    > initial call of the aspx page (without this I guess there's no way for
    > sure)
    >
    > Has anyone seen examples how to do this, and if so, where ??
    >
    > Soren
    >
    >
    Soren S. Jorgensen, Jan 21, 2006
    #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. Jeff Smythe
    Replies:
    3
    Views:
    1,239
    Jeff Smythe
    Jan 2, 2004
  2. Michael
    Replies:
    3
    Views:
    1,142
    Jim Cheshire
    Dec 30, 2005
  3. jnickfl1
    Replies:
    0
    Views:
    582
    jnickfl1
    Sep 18, 2006
  4. Replies:
    2
    Views:
    957
  5. Dax Westerman
    Replies:
    1
    Views:
    184
    Dax Westerman
    Aug 19, 2003
Loading...

Share This Page