My returnURL is not working in production

I am using RedirectFromLoginPage in my web app(.net 4). It works fine in my dev environment, but fails in my production environment.

When I login through dev, I get this URL:


However, when I push it to production, and login, I get this URL:

My web.config looks like this:

    <authentication mode="Forms">
        <forms loginUrl="Account/Login.aspx" timeout="300" defaultUrl="yourView.aspx" />

I've verified that my default document on my IIS 7 web server is Default.aspx. I even set it in web.config to make sure.

Is there anything I could do to fix this? The authorization section of web.config looks like this:

       <deny users="?" />



In the web.config, what does the section look like? It should read as follows:

   <deny users="?"/>

Or, it may be a cookie issue. Are you explicitly setting FormsAuthentication.CookieDomain anywhere? Since you're using a subdomain that could cause an issue. Also, try clearing the cookies in your cache or trying to login via a different browser to see if it's a cookie issue.

Need Your Help

Visual Studio not stepping into same-project constructor

c# visual-studio-2010

I am trying to debug some code, as a class is throwing an exception when called.