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

S

Soren S. Jorgensen

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
 
K

Kevin Spencer

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.
 
K

Kent Boogaart

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
 
S

Steve James

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
 
S

Soren S. Jorgensen

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,190
Latest member
ClayE7480

Latest Threads

Top