3

I'm using ASP.NET Forms Authentication with a simple way. The authentication use a cookie for store the credentials.

Works perfectly in browsers like: Desktop: Chrome, Safari, IE, ... Mobile: iPhone Browser, Opera Mobile ...

I press the button form's authentication and i redirect to the app page.

BUT, in Android browser i press the button and nothing.

The configuration of ASP.NET Forms Authentication is simple:

<authentication mode="Forms">
 <forms loginUrl="MLogin.aspx"
     timeout="30"
     name=".MOBAUTH"
     path="/"
     defaultUrl="Main.aspx"
     cookieless="AutoDetect">
  <credentials passwordFormat="Clear">
   <user name="dev" password="123456"/>
  </credentials>
 </forms>
</authentication>
<authorization>
 <deny users="?" />
</authorization>

Does anyone have any idea what might be happening?

Complementing...

MLogin.aspx use a simple method for authenticate the user:

private void authenticate()
{
    if (FormsAuthentication.Authenticate("dev", this.txtPass.Text.Trim()))
        FormsAuthentication.RedirectFromLoginPage("dev", true);

    Response.End();
}
1
  • 1
    is MLogin.aspx using standard logincontrol? all you have here is configuration, what about the page itself? Commented Nov 9, 2010 at 14:55

2 Answers 2

1

The reason is the Response.End(). That function prematurely kills your stream of data. There is no need for it at all.

Different browsers handle the Response.End() in different ways. Some will render the page even though you ended the stream, and some will not render it.

Sign up to request clarification or add additional context in comments.

Comments

0

Check the "expires" parameter in the response's Set-Cookie header field, and make sure your phone is set to the correct time & date. If the browser thinks the cookie is already past its expiry date, it won't store it.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.