dsxxqndv41105 2015-07-02 08:39
浏览 47

具有小超时值的PHP setcookie不起作用?

setcookie('cdate', date('Ymd'), time() + 120);

setcookie('cdate', date('Ymd'), time() + 82500);

I was trying to set a cookie with 2 minutes expired time. Strangely, no cookie is set with no. 1 but no. 2 it is working. I view the cookie in chrome and firefox. Any idea?

Btw, i am running php + IIS in my windows 7 locally.

  • 写回答

1条回答 默认 最新

  • dsa4d4789789 2015-07-02 10:45
    关注

    Please check your server time (it must be same with computer time): var_dump(date('H:i:s')). If it not the same with your computer time, you can change timezone on your server.

    评论

报告相同问题?