302 Endless loop

I have a web application that is stuck in an infinite loop, and I have no idea where to look next. This is an intranet site, so there is no link that I can provide, but I have listed so many details that I can think of below. I would be grateful for any ideas or suggestions. Does anyone have.

Details:

  • IIS 7
  • .Net 4.0
  • Windows 2008
  • The default document is Login.aspx
  • No HTTP redirect in app or Login.aspx in IIS
  • Fiddler shows Login.aspx using status code 302 and redirecting Login.aspx

If I open my site, it will point to Login.aspx and get stuck in loop 302. If I open the site but point to register.aspx, Fiddler shows register.aspx going to Login.aspx, which of course redirects to Login. aspx

What I've done:

  • Launch webapp from Visual Studio - everything works fine
  • Check web.config for redirection commands - no
  • Check IIS for redirection commands - no
  • Look at Fiddler on another page in the loop - they are not there, just Login.aspx for Login.aspx
  • Check Login.aspx for redirection commands - no
  • Check Login.aspx code for redirection commands - no
  • Run the application on my mailbox using web.config from the server - everything works
  • Check Login.aspx for redirection commands - no
  • Cleared cache - the problem still persists
  • Reprinted - issue still persists
  • Republished and cleared cache - issue still persists
  • Disabled default document in IIS
+5
source share
3 answers

Found a problem. Found this logic in MasterPage:

Dim strPage As String = Request.Url.AbsolutePath.Replace("/", "")
    'Check that user is logged in
    If Not strPage = "Login.aspx" And Not strPage = "Register.aspx" Then
        If Session("intUserId") Is Nothing Then
            Response.Redirect("~/Login.aspx", True)
        End If
    End If

, strPage Login.aspx Login.aspx .

, . , !

+2

, , , .

  • MVC MVC [RequiresHttps] .

  • , SSL ( , , http).

  • , , https.

  • .

+3

. Response.Redirect .

If (conditon1){
    Response.Redirect("Page1.aspx");
}
If (conditon2){
    Response.Redirect("Page2.aspx");
}

, else.

0
source

All Articles