I have an ASP.NET Website which was working well up untill this morning. All my users are unable to login!

I have spent the day trying to hunt down the issue with little luck.

Now, I have narrowed the issue down to IIS is not accepting the POST data.

Everytime the user POST's there username and password It is returning NULL for the Request.Form section of the data.

Locally on my Dev machine this works like it always did. I can even use Request.Form.Allkeys in order to show me all the data being sent.

I have used Google Chrome's Developer tools in order to check if the POST request is actually being sent, and yes, it is alongside the data.

It appears that IIS is not accepting anything or not holding the POST data at all as my ASP.NET code pick it up

Here is my login form:

<section id = "loginForm" >
    <form name="mainLog" method="post">
        @* If one or more validation errors exist, show an error *@
        @Html.ValidationSummary("Log in was unsuccessful. Please correct the errors and try again.", excludeFieldErrors:=True, htmlAttributes:=Nothing)
        <fieldset>
            <legend>Sign in to Your Account</legend>
            <ol>
                <li class="email">
                    <label for="email" @If Not ModelState.IsValidField("username") Then @<text> class="error-label" </text>  End If>Username</label>
                    <input type="text" id="username" name="username" />
                    @* Write any user name validation errors to the page *@
                    @Html.ValidationMessage("username")
                </li>
                <li class="password">
                    <label for="password" @If Not ModelState.IsValidField("password") Then @<text> class="error-label" </text>  End If>Password</label>
                    <input type="password" id="password" name="password" />
                    @* Write any password validation errors to the page *@
                    @Html.ValidationMessage("password")
                </li>
                <li class="remember-me">
                    <input type="checkbox" id="rememberMe" name="rememberMe" value="true" checked="@rememberMe" />
                    <label class="checkbox" for="rememberMe">Remember me?</label>
                </li>
            </ol>
            <input type="submit" value="Log in" />
        </fieldset>
    </form>
</section>

The below section shows where I am picking up this POST data:

If (IsPost) Then
        If Validation.IsValid() Then
            ' Attempt to log in using provided credentials


            'Recive username and password from form
            username = Request.Form("username")
            password = Request.Form("password")

On my local dev box, this is absolutly fine, username and password are receved and handled. However on my live IIS 8 Server they ALWAYS come out as null and there are no keys for the data.

Here is an example of the request (In BASH):

-H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.8' -H 'Upgrade-Insecure-Requests: 1' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Cache-Control: max-age=0' -H 'Referer: ' -H 'Connection: keep-alive' -H 'DNT: 1' --data 'username=bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' --compressed

The username data IS getting sent, but the Request.Form.AllKeys shows no data at all!

Like I mentioned, Locally, I have no such problems

Any help would really be appreciated to get my site back on-line!

Related posts

Recent Viewed