Session Variables between ASP Classic and ASP .NET

G

Guest

I have a classic ASP application that determines whether a user is logged in by examining a Session Variable, Session("LoginId"). Once logged in there is a link to a new search page (.aspx) this page basicaly allows searcing of the database and selection of users from a DataGrid. When a user in the DataGrid is selected (using hyperlink) you are returned to the .asp page, however the Session("LoginId") is empty and the users then have to log in again ? This happens randomly, i.e. if a user logs in again and repeats the process they stay logged in ?

The .aspx files are in a different Virtual Directory to the .asp files; is there any way that I can persist the Session Variables between apps.

Any help appreciated.
Tony
 
K

Kevin Spencer

Sessions are limited to the Application in which they reside.

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

Tony said:
I have a classic ASP application that determines whether a user is logged
in by examining a Session Variable, Session("LoginId"). Once logged in
there is a link to a new search page (.aspx) this page basicaly allows
searcing of the database and selection of users from a DataGrid. When a
user in the DataGrid is selected (using hyperlink) you are returned to the
..asp page, however the Session("LoginId") is empty and the users then have
to log in again ? This happens randomly, i.e. if a user logs in again and
repeats the process they stay logged in ?
The .aspx files are in a different Virtual Directory to the .asp files; is
there any way that I can persist the Session Variables between apps.
 
C

Cor

Hi Tony,

The session variables can time out, you can also (better) use the viewstat

(In asp.net)

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspnet/html/asp11222001.asp


I hope this helps?

Cor
I have a classic ASP application that determines whether a user is logged
in by examining a Session Variable, Session("LoginId"). Once logged in
there is a link to a new search page (.aspx) this page basicaly allows
searcing of the database and selection of users from a DataGrid. When a
user in the DataGrid is selected (using hyperlink) you are returned to the
..asp page, however the Session("LoginId") is empty and the users then have
to log in again ? This happens randomly, i.e. if a user logs in again and
repeats the process they stay logged in ?
The .aspx files are in a different Virtual Directory to the .asp files; is
there any way that I can persist the Session Variables between apps.
 
T

Troy

To help get around the issue I am using intermediate pages to transfer
session variables from asp to asp.net and vice versa. I pass the values
through/via a query string parameter to an intermediate page and then set
the appropriate variable. This is a crappy way to get the two apps to talk,
but it works for now. Also, one drawback is that you are not able to pass
objects (unless you serialize to a hidden textbox or serialize to a query
string and re-populate at the recieving side) from each server application.

Tony said:
I have a classic ASP application that determines whether a user is logged
in by examining a Session Variable, Session("LoginId"). Once logged in
there is a link to a new search page (.aspx) this page basicaly allows
searcing of the database and selection of users from a DataGrid. When a
user in the DataGrid is selected (using hyperlink) you are returned to the
..asp page, however the Session("LoginId") is empty and the users then have
to log in again ? This happens randomly, i.e. if a user logs in again and
repeats the process they stay logged in ?
The .aspx files are in a different Virtual Directory to the .asp files; is
there any way that I can persist the Session Variables between apps.
 

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,756
Messages
2,569,533
Members
45,006
Latest member
LauraSkx64

Latest Threads

Top