最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp 读写cookies 代码
时间:2010-04-09 编辑:简简单单 来源:一聚教程网
'函数名:ResponseCookies
'作 用:写入COOKIES
'参 数:Key ----cookie名
' value ----cookie值
' expires ---- cookie过期时间
'****************************************************
Public Function ResponseCookies(Key,Value,Expires)
DomainPath=Left(Request.ServerVariables("script_name"),inStrRev(Request.ServerVariables("script_name"),"/"))
Response.Cookies(Key)=""&Value&""
if Expires<>0 then Response.Cookies(Key).Expires=date+Expires
Response.Cookies(Key).Path=DomainPath
End Function
'****************************************************
'函数名:CleanCookies
'作 用:清除COOKIES
'****************************************************
Public Function CleanCookies()
DomainPath=Left(Request.ServerVariables("script_name"),inStrRev(Request.ServerVariables("script_name"),"/"))
For Each objCookie In Request.Cookies
Response.Cookies(objCookie)= ""
Response.Cookies(objCookie).Path=DomainPath
Next
End Function
' 使用方法
call ResponseCookies("111com.net","www.111com.net",now())
-
上一个: 获取url包括参数
-
下一个: asp 计算时间日期
相关文章
- ASP中Cookie读写的实现方法 01-18
- VBS 批量Ping的项目讲解 09-19
- 如何封装一个Ajax函数介绍 09-16
- ASP实现加法验证码方法 09-16
- ASP错误捕获的几种常规处理方法介绍 09-16
- ajax实现城市三级联动的代码介绍 09-16