Search code examples
c#asp.netsessioniis-7response.redirect

response.redirect issue in ASP.Net


I am using ASP.Net + VSTS 2008 + .Net 3.5 + C# + IIS 7. I am wondering if at server side, I call response.redirect to another Url in the same web application, whether session will be continued or terminated?

e.g. if I set session variable foo to value "goo" in a.aspx, then in a.aspx I call response.redirect to b.aspx, whether in b.aspx I can 100% get the value for session variable foo to be "goo"? My confusion is I heard response.redirect will not 100% continue session, is that true?

thanks in advance, George


Solution

  • Session values are persisted through the life of the session. The session will end after the browser closes or the timeout expires, or explicitly closed.

    http://msdn.microsoft.com/en-us/library/ms178581%28v=VS.90%29.aspx