Problem sharing session between classic ASP and ASP.NET

A

antonyliu2002

We are extending a web application written in classic ASP long time
ago. We will add more components to this web application in ASP.NET
2.0.

To use the web application, our web users will have to log in with
their user name and password.

Well, instead of adding components to the existing classic ASP web
application, we could have just put the extended components into a new
web application. But then this would require them to log into this new
application.

It is annoying to have to login twice, isn't it?

So, in our ASP.NET 2.0 components, we would like to get the login
information from the classic ASP page. Fortunately, login info is
probably the only data we wanna get from the classic ASP pages.

In our ASP.NET page, we have managed to get the user login info from
the classic ASP page through the trick provided by Peter A. Bromberg at
the following URL:

http://www.eggheadcafe.com/articles/20021207.asp

I have to say it is a great trick.

This trick works nicely in a folder which does not contain web.config.
But it seems the session objects cannot be transferred to any ASPX
pages in a folder that contains web.config. I've tested it a dozen of
times.

Did I make clear what problem I am having? If not clear, please ask.
If you have a good solution to sharing session objects between classic
ASP and ASP.NET, please educate. Thanks a lot.
 
S

Superman

Antony,

I know this situation all too well.

You've got to share your session objects...I would configure the
ASP.NET process to use SQL Server as the session provider and run the
asp.net session configuration scripts. I would then plug my ASP
application's session object to essentially write to the same location
as the asp.net application, therefore sharing information between the 2
applications. You will definitely have to write some code for this.

Good luck!
 
A

antonyliu2002

Superman said:
Antony,

I know this situation all too well.

You've got to share your session objects...I would configure the
ASP.NET process to use SQL Server as the session provider and run the
asp.net session configuration scripts. I would then plug my ASP
application's session object to essentially write to the same location
as the asp.net application, therefore sharing information between the 2
applications. You will definitely have to write some code for this.

Good luck!

Thanks. Does this mean that I have to install Microsoft SQL Server? I
am reluctant to do this. We use Oracle 10g as our database for our web
application.
 
A

antonyliu2002

Thanks. Does this mean that I have to install Microsoft SQL Server? I
am reluctant to do this. We use Oracle 10g as our database for our web
application.

Yes? Superman? Do I have to install MS SQL Server for this strategy?
We actually use Oracle 10g.
 
S

Superman

Sorry for the late reply,

No! You don't have to use SqlServer. You can configure your session
provider to use any data source necessary. For aspNet 2.0, take a look
at the "sessionState" element and use the "custom" provider model. You
can implement your own provider to store it in your Oracle database
just the same as a SqlServer implementation.

Good luck!
 
A

antonyliu2002

Superman said:
Sorry for the late reply,

No! You don't have to use SqlServer. You can configure your session
provider to use any data source necessary. For aspNet 2.0, take a look
at the "sessionState" element and use the "custom" provider model. You
can implement your own provider to store it in your Oracle database
just the same as a SqlServer implementation.

Good luck!

Thanks, Superman.

While I read through the MSDN documentation about this issue, I have
one question and I don't see how it is addressed.

OK, when a web user logs in from the classic ASP page, the SessionID
and the login info are written to the database.

Then, my ASP.NET application retrieves such info from the database.
But to retrieve John F Kennedy's login info instead of Marilyn
Monroe's, the ASP.NET application needs to know John's SessionID. But
how does it get to know this since the ASP.NET application is unaware
of what is going on in the classic ASP application? It seems to me
that some sort of communication directly between the classic ASP and
the ASP.NET applications is necessary.

Please share your wisdom. Thanks.
 
M

mhylden

We are currently using this solution on one of our projects. We are
now at the point of converting the application to .Net 2.0. Has anyone
had any experience with this - i.e. - does the SessionPage solution
still work with 2.0? One other thing that we would like to do for the
sake of easier maintenance is break out the classic ASP application and
run that separately under IIS. Is that possible, or do I need to keep
it in the same application, just under a subdirectory?

Thanks in advance,

Mikkel
 

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,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top