当设置cookie的过期时间$expire 为0时, 表示cookie的保存时间与浏览器进程一致,在浏览器进程未关闭状态,cookie均会存在,浏览器关闭后cookie会消失,php 手册上的解释为
“If set to 0, or omitted, the cookie will expire at the end of the session (when the browser closes). ”
解释意思为:
当设置cookie过期时间为0或者忽略不设置的情况下,cookie将会在session过期后过期(即浏览器关闭后cookie过期)。