Take the 2-minute tour ×

Some part of my site is Asp and the other is Asp.Net. I use session to save the information of current user in Asp pages. However,the session is lost on redirecting to an Asp.net page.

Sometimes,the session would be saved in the first redirecting Asp.net page. After a while, I click a button and find that session is still lost.

I am really confused about this situation. How could this happen?

ps: 1.I have checked the time-out configuration, it seems to work well. 2.The cookie configuration in brower looks normal.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

ASP and ASP.NET do not share Session state. They are completely different systems.

If you want to share Session state somehow between the two systems, you can use the method outlined in this article: http://msdn.microsoft.com/en-us/library/aa479313.aspx

share|improve this answer
Hi Roy, thanks for your help.One more thing, Could you tell me that how I lose the session in Asp.net pages. It seems that my data in session is lost when I click a button to redirect to another page(From asp.net page to asp.net page). –  Jack He Nov 6 '12 at 2:23
Jack, Session state within ASP.NET should remain unless in case of a time-out. For instance, if you open a page, then don't do anything for 15 minutes, then click a button, then the Session state will be lost (timing is configurable). –  Roy Dictus Nov 6 '12 at 7:07
You'll also lose the session if the app pool resets for some reason. –  Tim Nov 13 '12 at 14:59

Your Answer


