2

I am developing mobile web application using Jquery Mobile and MVC 3. I am using FormsAuthentication for the user authentication. Here is my code for Login button click

AuthenticationResult authResult = this.membershipService.Authenticate(username, password, remoteAddress);
if (authResult.IsAuthenticated)
            {
                FormsAuthentication.SetAuthCookie(username, false);
            }

authResult.RedirectAction + " To JSON Object"); return Json(new { action = "Index", });

On logout button i have written the code

public ActionResult LogOff()
    {
        FormsAuthentication.SignOut();
        Response.Cookies.Clear();            
        return RedirectToAction("Index", "Home");
    }

This is working fine on windows machine safari browser

When i open my application on iPad safari browser:

  1. Give login crendential and click ok, it is redirecting me to the appropriate screen.
  2. Log out and Close the safari browser on iPad
  3. Reopen the safari browser and do the step 1, this time it is redirecting me to Login screen.
  4. I have to clear the browser cookies thn only it is redirecting me to appropriate screen

I also clear the cookies on Login Screen but it is not working. Can someone help me out here?

Florin Stingaciu
  • 8,085
  • 2
  • 24
  • 45
user1774777
  • 31
  • 1
  • 4
  • I had this same problem, you should take a look at this: http://stackoverflow.com/questions/12506897/is-safari-on-ios-6-caching-ajax-results – Alejo Nov 24 '12 at 01:09
  • I had the same issue. Read this post, I think it should help you: http://stackoverflow.com/questions/412300/formsauthentication-signout-does-not-log-the-user-out – Oleg Krymskyi Oct 16 '13 at 07:54

0 Answers0