首页 > 学院 > 编程设计 > 正文

如何提示用户打开Cookie?

2020-06-19 13:51:45
字体:
来源:转载
供稿:网友

Dim strCookie, strTry

strCookie = Request.Cookies("MyCookie")  

strTry = Request.QueryString("Try")

     

If strCookie = "" Then     

' 检测否是设置了Cookie.

 

If strTry = "" Then   

         Response.Cookies("MyCookie") = "Set"

' 重定向到这一页面再试.

       

Response.Redirect(Request.ServerVariables("script_NAME")

& "?Try=Yes")

      Else       

     ' 如果没有开启Cookie.

 

 End If 

 Else

 ' 客户端正在接受Cookie.

 

Response.Cookies("MyCookie").Expires = "April 15, 2001"

End If

 

 

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表