My returnURL is not working in production

I am using RedirectFromLoginPage in my vb.net 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:

http://localhost:63509/Account/Login.aspx?ReturnUrl=%2fDefault.aspx

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

http://aaa.aaa.edu/Account/Login.aspx?ReturnUrl=%2f

My web.config looks like this:

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

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:

    <authorization>
       <deny users="?" />
    </authorization>

Thanks

Answers


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

<authorization>
   <deny users="?"/>
</authorization>

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.