Reputation: 2521
Okay, it’s an established fact that the Session object in ASP has no relation to the Session object in ASP.NET.
My question is this: If I have an ASP page, and it calls an ASPX page, which then does a Response.Redirect to another (or the same) ASP page, will the Session variables from the original ASP page be preserved in the final ASP page? Does anybody know the answer, or do I need to experiment and see?
Upvotes: 3
Views: 1707
Reputation: 29041
will the Session variables from the original ASP page be preserved in the final ASP page?
Short answer: yes.
This is no different than if you left a page on your ASP site, used that browser window/tab to go to another site like Google, then came back. Your session will be preserved as long as it hasn't timed out or been collected, or any of the other standard things that can happen to invalidate a session.
The ASP and ASP.NET apps are effectively separate applications - almost separate sites, even if they live in the same folder structure - that happen to be running on the same server. They can't share data (without jumping through some hoops like storing things in a database) and aren't aware of each other.
Upvotes: 4
Reputation: 1302
Yes, the session will exist in asp classic in most circumstances. A few things to consider though:
SessionTimeout
has been reached the instances will be destroyedUpvotes: 0
Reputation: 572
I don't believe your session variables will be destroyed unless you either close the browser or clear the session via code.
Upvotes: 0
Reputation: 1705
One way to share session variables between asp and asp.net is: http://www.eggheadcafe.com/articles/20021207.asp
Upvotes: 1