关于cookies的使用问题
seav 2009-03-17 01:10:39 <%
'增加会员的积分
Sub Per_AddJifen(id)
dim inputid,pid
pid=id
pid=replace(trim(pid),"'","")
pid=replace(trim(pid)," ","")
if isnull(pid) then pid="" end if
if pid<>"" then
inputid=Request.cookies("inputid")
if inputid="" then
conn.execute("update member set jifen=jifen+1 where id="&pid)
Response.Cookies("inputid")=pid
Response.Cookies("inputid").Expires=date()+30
response.Write("有执行!")
end if
end if
End sub
Call Per_AddJifen(request("pid"))
%>
以上asp程序,功能是当访问者通过http://www.xxxx.com/index.asp?pid=1233 这样访问网站,在index.asp加入以上代码,相应会员号1233就会增加一个积分,使用cookies记录30天内是否已访问过.
第一次访问http://www.xxxx.com/index.asp?pid=1233 ,会员1233积分可以增加1分.网页也显示"有执行!"
关闭IE,在没有清理cookies的情况下,再访问http://www.xxxx.com/index.asp?pid=1244 ,会员1244积分可以增加1分,但是网页没有显示"有执行!",为什么呢?