By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,811 Members | 1,623 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,811 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Jan 20 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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" <no****@nodomain.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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

Jan 20 '06 #2

P: n/a
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" <no****@nodomain.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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

Jan 21 '06 #3

P: n/a
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

Jan 21 '06 #4

P: n/a
Bone up on Billy Yuen's MSDN article on how to do that :

http://msdn.microsoft.com/asp.net/re...rttoaspnet.asp


Juan T. Llibre
ASP.NET MVP
============
"Soren S. Jorgensen" <no****@nodomain.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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

Jan 21 '06 #5

P: n/a
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" <no****@nodomain.com> skrev i en meddelelse
news:%2****************@TK2MSFTNGP10.phx.gbl...
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

Jan 21 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.