默认单位是秒。比如设置过期时间为 1 小时,也就是3600 秒时,是用时间戳算的,而时间戳的单位整好是秒。setcookie( “user”,“php”,time()+3600);
有效期是秒,例如30天有效期可以这样设置:time()+60*60*24*30