Hi
I have a small application that uses the asp.net Membership Provider.
The Application is in 2 parts, Normal Web Browser and Mobile.
In the Normal Web Browser Version I have a logon screen that consists of an asp:Login Form.
This works fine and when I am redirected I have a LoginView that displays the Current Username.
However because of formatting issues in the Mobile Version I chose to have regular asp:Textbox's to collect the login details.
A button then runs the following Code.
string username = _username.Value, password = _password.Value; if(Membership.ValidateUser(username, password)) { Response.Cookies.Remove(FormsAuthentication.FormsCookieName); FormsAuthentication.SetAuthCookie(username, false); // Ensure that after logging in, mobile users stay on mobile pages string returnUrl = Request.QueryString["ReturnUrl"]; if (String.IsNullOrEmpty(returnUrl)) { returnUrl = "~/Mobile/"; } Response.Redirect(returnUrl); } else { _failureText.Text = "Your login attempt was not successful. Please try again."; }
This works ok and logs me on and then I am able to browse around the restricted areas of the site no problem.
And I also get the Current Username displayed in my LoginView.
However, when I upload the application to the Production Environment which uses SSL.
My Normal Browser works fine. But when I login to the Mobile Version instead of seeing the Current Users Name in my Login View I just get "username".
If I login via the normal view and then browse to the mobile view, the LoginView is fine. It only happens when Logging in using the mobile login page which uses the code above.
Its only a small thing and to be honest I am close to just removing the LoginView altogether, but it is just annoying me now. Mostly beacuse it actually works in my Dev Environment.
Any thoughts?
Regards
Ronnie79