标签:cookie
登录时存:
HttpCookie cookieUserPower = new HttpCookie("UserPower");
cookieUserPower.Value = loginuser._UserPower.ToString();
HttpContext.Current.Response.Cookies.Add(cookieUserPower);
页面判断:
if (Request.Cookies["UserID"] == null)
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "sc", "<script>window.location.href=‘WorkerLogin.aspx‘;</script>");
}
else if (Request.Cookies["lzf"].Value.Trim() == "-1")
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "sc", "<script>alert(‘您还没有通过审核!‘);window.location.href=‘WorkerStudy.aspx‘;</script>");
}
本文出自 “技术人生” 博客,请务必保留此出处http://zhaoyingyatou.blog.51cto.com/7151735/1433669
标签:cookie
原文地址:http://zhaoyingyatou.blog.51cto.com/7151735/1433669