Question

I have a web site that we moved from one host to another. I also have the site running on my development machine. On my development machine and on the old host I could log into my administer section successfully. On the new host the Administer login page logs in successfully which I can see in the members table but just reposts to itself instead of going to the correct page. I have tried everything I can think of and that I have found on the web. I explicitly put the application name in the Web config providers and profiles sections. In an attempt to see what was happening I put a label on the login form, removed the destination page url from the login control and put in the following code to explicitly go to the default page.

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    If IsPostBack Then
        If User.Identity.IsAuthenticated = True Then
            Response.Redirect("~/Admin/Default.aspx")
            lblResponse.Text = "Passed"
        Else
            lblResponse.Text = "Fail"
        End If
    Else
        lblResponse.Text = "New load"
    End If
End Sub

Works fine on the development machine, but on the hosting site I get a new post of the login page, not a repost. Any suggestions would be much appreciated.

No correct solution

OTHER TIPS

Have you tried to republish the whole project again. Also you should verify that you gave all the right that are necessary to the computer that want to access the new server.

There could be a different security setting on the destination file or folder after login. So when you user is not authenticated for that page, it just redirects back to login.

Check windows security on the file or folder.

It sure sounds like ~/admin/default.aspx is redirecting because it does not like the user's auth ticket.

  • Has the host name changed? Are you sure you are accepting the auth cookie (ticket)?
  • Is the user authenticating with the correct roles? I would look in Web.config and verify any role settings for the page? Try removing roles temporarily?

web.config:

<location path="AdminFolder">
  <system.web>
    <authorization>
      <allow roles="Admin"/> //try modifying this temporarily
      <deny users="*"/>
    </authorization>
  </system.web>
</location>

I just had the same problem. I'm working with ASP.NET, .NET Framework 4.5. The issue only reproduced in development environments, on my computer and several others, but not in general and not in production. I still haven't found a good solution, but what I can say is that for me the problem is solved in incognito mode (Google Chrome). All other solutions mentioned here didn't apply to me.

LE: I found my definitive solution: delete all cookies for that respective site.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top