Home > Backend Development > PHP Tutorial > php cookie使用有关问题

php cookie使用有关问题

WBOY
Release: 2016-06-13 10:36:04
Original
856 people have browsed it

php cookie使用问题
现在很多购物展用到了 cookie 最大的用处就是 购物车 
我看了别人做的 如果不是会员 就生成一个cookie 然后把内容 插入到数据库中
现在我想问的是 怎么能让cookie失效时 删除数据库里的内容

------解决方案--------------------
写入cookie时总有个过期时间吧,数据库里也记录这个过期时间,然后用一个定时任务(每周,数据量大可以每天)清理一下过期的记录

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template