例子如下:
}
protected void btnRemoveCookie_Click(object sender, EventArgs e)
{
Response.Cookies.Remove(\"UserInfo\");
Response.Write(\"<script type=\\\"text/javascript\\\">alert(\\\"删除Cookie成功!\\\");</script>\");
}
protected void btnCheckCookie_Click(object sender, EventArgs e)
{
if (Request.Cookies[\"UserInfo\"] != null)
{
Response.Write(\"Cookie存在,\"+Request.Cookies[\"UserInfo\"].Value);
}
else
{
Response.Write(\"Cookie不存在\");
}
}
本文地址:https://www.stayed.cn/item/21038
转载请注明出处。
本站部分内容来源于网络,如侵犯到您的权益,请 联系我