title: The page isn't redirecting properly after MVC 3 deploy
body: <p>I'm deploy my MVC 3 application to a server and, after solve several issues related with missing MVC dlls (the server does not have MVC installed) it start to give a error:</p>
  
  <p><strong>Firefox</strong> "The page isn't redirecting properly"
  <strong>Chrome</strong> "This webpage has a redirect loop"
  <strong>IE</strong> "This page can't be displayed"</p>
  
  <p>I found people saying that it is something cookie related, but I can't understand how to solve the problem.</p>
  
  <p>I never see the default page whether.</p>
  
  <p>I suspect there is a problem with my Global.asax file or my Web.Config.</p>
  
  <p><strong>Global.asax</strong>:</p>
  
  <pre><code>public class MvcApplication : System.Web.HttpApplication
  {
      public static void RegisterGlobalFilters(GlobalFilterCollection filters)
      {
          filters.Add(new HandleErrorAttribute());
      }
  
      public static void RegisterRoutes(RouteCollection routes)
      {
          routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
          routes.MapRoute(
              "Default", // Route name
              "{controller}/{action}/{id}", // URL with parameters
              new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
          );
  
      }
  
      protected void Application_Start()
      {
          AreaRegistration.RegisterAllAreas();
  
          RegisterGlobalFilters(GlobalFilters.Filters);
          RegisterRoutes(RouteTable.Routes);
      }
  
  }
  </code></pre>
  
  <p>And there is a part of my <strong>Web.Config</strong> without AppSettings, connectionStrings and system.serviceModel:</p>
  
  <pre><code>  &lt;system.web&gt;
      &lt;compilation debug="true" defaultLanguage="c#" targetFramework="4.0"&gt;
        &lt;assemblies&gt;
          &lt;add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
          &lt;add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
          &lt;add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
          &lt;add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
          &lt;add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
          &lt;add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /&gt;
        &lt;/assemblies&gt;
      &lt;/compilation&gt;
      &lt;authentication mode="Forms"&gt;
        &lt;forms loginUrl="~/Account/LogOn" timeout="2880" /&gt;
      &lt;/authentication&gt;
      &lt;pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"&gt;
        &lt;namespaces&gt;
          &lt;add namespace="System.Web.Helpers" /&gt;
          &lt;add namespace="System.Web.Mvc" /&gt;
          &lt;add namespace="System.Web.Mvc.Ajax" /&gt;
          &lt;add namespace="System.Web.Mvc.Html" /&gt;
          &lt;add namespace="System.Web.Routing" /&gt;
          &lt;add namespace="System.Web.WebPages" /&gt;
        &lt;/namespaces&gt;
      &lt;/pages&gt;
      &lt;customErrors mode="Off"&gt;
        &lt;error statusCode="404" redirect="/Error/PageNotFound" /&gt;
      &lt;/customErrors&gt;
    &lt;/system.web&gt;
    &lt;system.webServer&gt;
      &lt;modules runAllManagedModulesForAllRequests="true" /&gt;
      &lt;handlers&gt;
        &lt;remove name="UrlRoutingHandler" /&gt;
      &lt;/handlers&gt;
    &lt;/system.webServer&gt;
    &lt;runtime&gt;
      &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /&gt;
          &lt;bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" /&gt;
        &lt;/dependentAssembly&gt;
      &lt;/assemblyBinding&gt;
    &lt;/runtime&gt;
  </code></pre>
  
  <p><strong>Index</strong> action from Login page:</p>
  
  <pre><code>public ActionResult Index()
   {
     if (CurrentAuthenticatedData != null &amp;&amp; CurrentAuthenticatedData.User != null)
       ViewBag.IsLogin = true;
     else
       ViewBag.IsLogin = false;
  
       return View();
    }
  </code></pre>
  
  <p><strong>CurrentAuthenticatedData</strong>:</p>
  
  <pre><code>System.Web.Routing.RequestContext Ctx = null;
  public AuthenticatedData CurrentAuthenticatedData
  {
      get
      {
          AuthenticatedData retval = null;
  
          if (Ctx.HttpContext.User.Identity.IsAuthenticated)
          {
              retval = (AuthenticatedData)ViewBag.Auth;
          }
  
          return retval;
      }
  }
  </code></pre>
  
  <p>AuthenticatedData is a class where I store several attributes related to logged user.</p>
  
  <p>And finally my <strong>View</strong> code:</p>
  
  <pre><code>@{
      ViewBag.Title = "Index";
  }
  
  &lt;h2&gt;Efetuar Login&lt;/h2&gt;
  
  
  @using (Html.BeginForm()) 
  {
      &lt;div style="@(ViewBag.IsLogin??false ? "display: none" : "")"&gt;
          @Html.ValidationMessage("Error")
          &lt;p&gt;Username:&lt;input type="text" name="usr" /&gt;&lt;/p&gt;
          &lt;p&gt;Password:&lt;input type="password" name="pwd" /&gt;&lt;/p&gt;
          &lt;p&gt;
              &lt;input type="submit" value="Login" /&gt;
          &lt;/p&gt; 
      &lt;/div&gt;
  }
  </code></pre>
  
  <p>I try to deploy a dummie MVC application and it works! =/</p>
  
  <p>Can you help me?</p>
  
  <p>Thanks</p>