The anti-fake token provided is intended for the user ", but the current user is" xxxx ".
I followed every possible solution to get rid of this error without any success:
Here is the scenario: I have two separate tabs to enter my browser. Tab B: 1. I went to my site in Tab A 2. Then try logging in to Tab B
The above error occurs
In my MVC MVC login view:
v class="col-md-4 col-md-offset-4"> <form class="form-signin" role="form" action=@Url.Action("Login", "Account") method="POST" id="signInForm"> @Html.AntiForgeryToken() <div class="form-group"> <label for="loginEmail">Email</label> <input type="text" id="loginEmail" name="loginEmail" class="form-control" placeholder="Email address" > </div> <div class="form-group"> <label for="loginPassword">Password</label> <input id="loginPassword" type="password" name="loginPassword" class="form-control" placeholder="Password" > </div> <button class="btn btn-lg btn-primary btn-block main-btn" type="submit">Sign in</button> <div> <br> <a href="@Url.Action("Index","GettingStarted")">Register</a><br> <a href="@Url.Action("ForgotPassword","Account")">Forgot your password?</a> </div> </form>
And my account controller is like this:
[HttpPost] [AllowAnonymous] [ValidateAntiForgeryToken] public ActionResult Login(LoginModel model) { if (ModelState.IsValid) {
How can I fix this error?
c # asp.net-mvc
user1526912
source share