asp 关闭浏览器,怎么清除COOKIES记录

来源:百度知道 编辑:UC知道 时间:2024/06/04 06:32:45
当用户登录成功

username=request.cookies("aa")("username")
conn.execute("insert into online (username,datetime,ip) values ('"&username&"','"&now()&"','"&getip&"')"

当用户退出成功

conn.execute("delete online where username='"&username&"'"
response.cookies("aa")("username")=""

但当关闭浏览器,COOKIES是自动清除了,但是ONLINE表中数据却没有清除

这个程序应该怎么写!
上面的程序都可以正常运行!
登录成功后,写入USERNAME的数据
现在的关键问题,是在我不正常退出的情况下,如:直接关闭浏览器,电脑死机的等情况下,怎么把这online 里的USERNAME删除!

是delete from online where ...
掉关键字了

补充:
online表里加一个时间字段“ExpTime”,执行
delete from online where "&now()&" - ExpTime > 0.014
0.014约等于20分钟

你如果用session的话 关了浏览器就session就清除了