Script C# Browser Accetta Cookies
Testare se un browser accetta i cookies
private void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack)
{
if (Request.QueryString["AcceptsCookies"]==null)
{
Response.Cookies["TestCookie"].Value = "ok";
Response.Cookies["TestCookie"].Expires =
DateTime.Now.AddMinutes(1);
Response.Redirect("TestForCookies.aspx?redirect=" +
Server.UrlEncode(Request.Url.ToString()));
}
else
{
labelAcceptsCookies.Text = "Accept cookies = " +
Request.QueryString("AcceptsCookies");
}
}
}