views:

456

answers:

1

I have an webforms app that loses it's session variables on response.redirect. I've read Bertrand Le Roy's blog about this and still can't get it to work.

The page works in production. However, when I try in the VS2k8 IDE, the session variables are there right before response.redirect and on the first line of the next page, the variables are nothing. I've confirmed the session id is the same so I'm not skipping sessions. The target page is relative so the web server doesn't think we're changing sites (as confirmed by the sessionid).

Here is the line I'm using:

Response.Redirect("menu.aspx", False)

Ideas?

A: 

This line in your question has me confused: "The target page is relative so the web server doesn't think we're changing sites."

Are both the pages (the source and destination) in the same app domain?

Are you losing all the Session variables or just the ones that are set on this one request? Set something on a previous page cycle and see if that is saved.

Bryan
I'm linking relatively. So, the redirect is to 'menu.aspx' rather than 'domain.com\menu.aspx'. Yes, it's the same app. All session variables are lost. I set a variable on the first page, redirect with the overloaded method as false and when I check the session variable on page load of the next page, the value is 'Nothing'.
asp316
In that case, there is something very fishy going on. Can you reproduce this on a minimal test page?
Bryan