1

My controller is shown below:

    [ValidateAntiForgeryToken]
    [HttpGet]
    public ActionResult LogIn()
    {
        return View();
    }

And my view shown below:

@model Fancy.Management.Model.Home.LogInModel
<html>
<head>
<title>Giriş</title>
</head>
<body>
@using (Html.BeginForm())
{ 
    <table>
        <tr>
            <td>Kullanıcı Adı:</td>
            <td>@Html.TextBoxFor(m => m.UserName)</td>
        </tr>
        <tr>
            <td>Şifre:</td>
            <td>@Html.PasswordFor(m => m.Password)</td>
        </tr>
        <tr>
            <td></td>
            <td>
                @Html.AntiForgeryToken()
                <input type="submit" value="Giriş" /></td>
        </tr>
    </table>
}
</body>
</html>

Everythings looks good but i got exception:The required anti-forgery cookie "__RequestVerificationToken" is not present.

Have you any idea?

ftdeveloper
  • 1,053
  • 3
  • 26
  • 50
  • 3
    http://stackoverflow.com/questions/4914994/using-mvc3s-antiforgerytoken-in-http-get-to-avoid-javascript-csrf-vulnerability you can't use antiforgery tokens on HTTP GET. – Thousand Jul 22 '13 at 20:55

1 Answers1

-2

Some mobile device not excute POST, instead, GET will be excuted and not submit token and exeption will be throwed..

Thanh Tung
  • 95
  • 1
  • 3