0

I am tring to login using asp.net authentication in nokia e5-00 device. The login proccess success under explorer, firefox, android device and so on. But in the nokia device the HttpContext.Current.User.Identity.IsAuthenticated is false even though the authentication succeeded.
Here is my login method:

public static void Login(User user)
        {
            HttpResponse Response = HttpContext.Current.Response;
            HttpRequest Request = HttpContext.Current.Request;

            FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,
                user.Id.ToString(), DateTime.Now, DateTime.Now.AddHours(12), true,
                user.Id.ToString());

            string data = FormsAuthentication.Encrypt(ticket);
            HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, data);
            cookie.Expires = ticket.Expiration;

            Response.Cookies.Add(cookie);

            string redirectUrl = UserPages.Home;
            Response.Redirect(redirectUrl, false);
        }

Later, in the aspx page, when I try to get the user, HttpContext.Current.User.Identity.IsAuthenticated is still false.

But in all other browsers IsAuthenticated is true and everything is fine.

This behavior happens in all nokia devices. After checking, I see the the cookie stored in the nokia but IsAuthenticated is still false.

What can cause to this problem? What is wrong with the nokia devices??

Naor
  • 23,465
  • 48
  • 152
  • 268

1 Answers1

0

I don't really knows what was the problem, but this is how I solved it:

Instead the use of my public static void Login(User user) I used:

FormsAuthentication.RedirectFromLoginPage(user.Id.ToString(), true);

Again, I am not sure what is the difference or why does this work while my original method doesn't.

If anyone has an answer, I'll be glad to know.

Thanks.

Naor
  • 23,465
  • 48
  • 152
  • 268