Forms (Login) working in Mozilla Firefox but not in any version of Internet Explorer?

Hey guys,

I’m in dire need of help as my head is about to explode… I’ve dealt with loads of faulty forms in my development time and there’s usually a typo or a reference error or the like… but In this case… I can’t find it! What makes this even more strange is that the form works flawlessly in FireFox and even Google Chrome, however as soon as I fire at it in any version of Internet Explorer (I’ve tried 9, 8 and 6-compatability so far) it simply refreshes the form without the functionality (in this case, logging in)…

The code for my form is pretty straight forward:



<%@ Control Language="C#" AutoEventWireup="true" CodeFile="login.ascx.cs" Inherits="LoginUC" %>

<style type="text/css">
.formholder { overflow:hidden; width:800px;}
.formrow { padding:5px 0; clear:both; float:left; width:100%; clear:both; }
.formleft { float:left; width:30%; margin:0; line-height:20px; font-size:1.4em; padding:8px 0 0 0; }
.formright { float:right; width:59%; }
.formrow input[type=text], .formrow input[type=password] { padding:6px; width:250px; }
.formrow input[type=submit], .formrow input[type=button] { padding:3px 7px; cursor:pointer; }
.formrow select { padding:6px; width:255px; }
.formrow label.error { margin:0 0 0 10px;}
p.formerror { font-weight: bold;color: red;}
</style>

<asp:Literal ID="litError" runat="server" />
<asp:Login RenderOuterTable="false" ID="ctlLogin" runat="server" OnLoginError="OnLoginError" onloggedin="OnLoggedIn" RememberMeSet="True" VisibleWhenLoggedIn="False">
    <LayoutTemplate>
        <div id="login">

            <div class="formholder">

            <div class="formrow">
                <div class="formleft"><label>Username</label></div>
                <div class="formright">
                    <asp:TextBox ID="UserName" CssClass="textbox required" ToolTip="Enter username" runat="server"></asp:TextBox>
                </div>
            </div>

            <div class="formrow">
                <div class="formleft"><label>Password</label></div>
                <div class="formright">
                    <asp:TextBox ID="Password" CssClass="textbox required" ToolTip="Enter password" runat="server" TextMode="Password" />
                </div>
            </div>

            <div class="formrow">
                <div class="formleft">&nbsp;</div>
                <div class="formright">
                    <asp:CheckBox ID="RememberMe" runat="server" Text="Keep me logged in" />
                </div>
            </div>

            <div class="formrow">
                <div class="formleft">&nbsp;</div>
                <div class="formright">
                    <asp:Button ID="LoginButton" CssClass="loginButton" runat="server" CommandName="Login" Text="Login" />
                </div>
            </div>

            </div>

        </div>

    </LayoutTemplate>
</asp:Login>

With the CommandName=“Login” being the crucial part I suppose… This is a simple form I created, but I have tried with the standard Visual Studio 2010 Drag-and-Drop login form control, with the same result!

I’m starting to think it might be something code-unrelated? I’m running the site on Windows Server 2008 R2 x64 - ISS 7 and .NET 4.0 Classic

Has anyone experienced anything similar or know what to do? Help would be very much appreciated! This is doing my head in…

Thanks in advance!

EDIT: I’ve tried writing the codebehind myself (and partly from a guide) to take care of the login myself, however the exact same thing happens…

This is my codebehind file (Note: I am using the CMS Umbraco membership provider (pretty much identical to ASP.NET membership) hence the Member class instead of the User class.

With this, Mozilla still works flawlessly, IE redirects to the SuccessfulLoginPage upon successful validation, but still does not log the user in…

Any thoughts?

Code-behind:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using umbraco;
using umbraco.cms.businesslogic.member;

public partial class LoginUC : UserControl
{
    // Macro Parameters
    public int SuccessfulLoginPage { get; set; }

    // Error format
    private const string ErrorFormat = "<p class=\\"formerror\\">{0}</p>";

    // If there is an error logging in, this method will fire and put the error in the error lit
    protected void OnLoginError(object sender, EventArgs e)
    {
        litError.Text = string.Format(ErrorFormat, ctlLogin.FailureText);
    }

    // This fires once the user has successfuly logged in
    protected void OnLoggedIn(object sender, EventArgs e)
    {
        // ** OPTIONAL! **
        // You can do some custom logic here to check if user is banned or something similar
        // Get the user
        var m = Member.GetMemberFromLoginName(ctlLogin.UserName);
        // ** OPTIONAL! **

        // Send the user to the correct authenticated page, once successfully logged in
        Response.Redirect(library.NiceUrl(SuccessfulLoginPage));
    }
}


My bet isn’t on anything in your code but rather environmental – IE will pass windows credentials, which IIS understands, when it thinks it is on a private network. Generally that is defined as non-fully-qualified hostnames (like localhost). I’d try a fully qualified domain name, or disabling that functionality, just to see if that is in fact the issue. Then troubleshooting should be easy . . .

Thanks for the reply.

I’ve been messing with the environment (my Windows 2008 Server) for days now… with no success. I then tried hosting the application on a different server (a shared one) where the same problem occured… I read somewhere about someone who had a similar issue and fixed it by changing the name of the authentication cookie and making sure that the cookie and session are “sent” at the same time… Looking into that now…

This is so not a good way to spend the first spring weekend!

Had a similar issue when upgrading a website, The user was validated but when the page went to actually log them in it would redirect to the login page as if nothing happened. It never through and error or anything. I traced the issue back to the authentication cookie. Before the conversion the user had, created a persisted cookie on their browser. that cookie was authored with a different domain listed in the config with the same Name. Just had to clear the cookies and problem solved. although I’m still searching on how to do this in code. Kinda tricky since the cookie doesn’t show up since it has expired… Frustrating.

Have you tried clearing cache? It might be the problem. If the code running in Mozilla it must have to run in IE.