I am trying to handle the duplicated form posting by using the anti forgery token as answered here the problem arises when a duplicate identical form post request arrives it is successfully identified but i am unable to handle it properly. I am doing
if (ctx.Session["userform"] != null)
{
if (_antiForgToken.Equals(ctx.Session["userform"].ToString()))
{
//kill the request
response.Clear();
response.ClearContent();
response.Close();
}
}
else
ctx.Session["userform"] = _antiForgToken;
}
the question is how can i just drop the duplicated HTTP request as if it never happened...
You still need to respond to the request made by the client right and just killing the response will not help. Probably send a reponse with a status code 400.