Sharing Session variables with ASP pages?

S

Selden McCabe

I have an old ASP project, and I'm adding some functionality in ASP.Net.

I stuff some information into Session variables in the ASP page, then
redirect to the ASP.Net page.

But when I pull up the session variables, they are empty!

Is it possible to share session variables this way?

Thanks,
---Selden
 
K

Kevin Spencer

ASP and ASP.Net are 2 completely different ISAPIs, each having its own
memory space. So, the short answer is "no." You CAN share any serializable
Session data by passing it from one app to the other via HTTP request. For
example, if you want to set an ASP.Net Session variable from an ASP app, you
could pass it as a QueryString parameter or as part of a form post.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
P

PL

No it's not possible, however you can use several techniques
to make it share (or something to that effect).

The simplest is to use the querystring and a hidden 1x1 pixel image
on the pages, then loop through the sessions and put them into the
querystring.

However printing out the sessions in the querystring is not a secure
solution and of course it won't work if you stuff other things
than strings into the session variables.

Another way is to use hidden form fields but the same security issue there.

There are numerous articles with more and less complicated
solutions for sharing sessions between classic asp and asp.net,
do a google search.

PL.
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top