Why my cookie not showing up on linked page?

后端 未结 1 1775
無奈伤痛
無奈伤痛 2021-01-28 11:04

very simple question.

This is my index.php:



         


        
1条回答
  •  时光说笑
    2021-01-28 11:38

    86400 is a long, long time ago in the past.

    Your cookie expires immediately.

    See the documentation:

    The time the cookie expires. This is a Unix timestamp so is in number of seconds since the epoch. In other words, you'll most likely set this with the time() function plus the number of seconds before you want it to expire. Or you might use mktime(). time()+60*60*24*30 will set the cookie to expire in 30 days. If set to 0, or omitted, the cookie will expire at the end of the session (when the browser closes).

    0 讨论(0)
提交回复
热议问题