如何让用户再次访问我的网站时不需再提交相关信息?

 更新时间:2006年11月16日 00:00:00   作者:  

< %@ LANGUAGE="VBscript" %  >
< %
Chunfeng=Request.Cookies("Chunfeng")

' 初始设置页面,读取名字为ChunfengCookie.
If Chunfeng ="" then

' 判断是否已经存在Cookie.
  Response.Cookies("Chunfeng")="x"
  Response.Cookies("Chunfeng").Expires=#January 01, 2010#
  Response.Redirect "Chunfeng.asp"

' 如果不存在,就创建并设置Cookie,并转到页面Chunfeng.asp.当下次访问时,因为存在Cookie,就不会再转到Chunfeng.asp 页面.
Else
'rest of the page

' 如果Cookie已经存在,则访问者将执行页面中剩余的代码.
End if
% >

相关文章

最新评论