title: Facebook C# SDK - Issues when redirecting to another page
body: <p>I have an IFrame Facebook applicagtion (asp.net / Facebook C# SDK <a href="http://facebooksdk.codeplex.com/" rel="nofollow">http://facebooksdk.codeplex.com/</a>).
  Default page works fine. I use the foolowing code to authenticate:</p>
  
  <pre><code>IFacebookSettings FbSettings = FacebookSettings.Current;
  FacebookApp Fb = new FacebookApp(FbSettings);
  CanvasAuthorizer FbAuthorizer = new CanvasAuthorizer(Fb);
  
  if (!FbAuthorizer.IsAuthorized())
  {
      Response.Redirect("~/Login.aspx?returnUrl=" + HttpUtility.UrlEncode(Request.Url.PathAndQuery));
      Response.End();
  }
  else
  {
      CurrentUser = new FacebookUser((JsonObject)Fb.Api("/me"));
      CurrentUser.AccessToken = Fb.AccessToken;
  }
  </code></pre>
  
  <p>this code is in BasePage class OnInit that is derived from System.Web.UI.Page. Other pages are derived from BasePage</p>
  
  <p>On first load (default.aspx) the authentication suceedes (user gets redirected to login page, and then automatically redirected back, like in example provided in SDK).</p>
  
  <p>So, when the homepage (default.aspx) is finally loaded, i press a hyperlink that is on the page. The hyperlink navigates the IFrame to another aspx file in a subfolder that is also derived from BasePage class.</p>
  
  <p>Here is where the problem occurs:<br>
  When the second (inner) aspx gets loaded, it gets redirected to logn page too and then back. In some cases (Internet explorer / Safari) i get an infinire redirect to login and back to inner page.</p>
  
  <p>what am i doint wrong?</p>
  
  <p><strong>EDIT:</strong> I had an invalid <code>canvasUrl</code> setting in web.config that was pointing to an invalid URL, this question should be considered closed.</p>