Why does setting a cookie without time() result in the expiration date being displayed as 1970?

Setting a cookie without providing an expiration time defaults to 0, which represents the Unix timestamp of January 1, 1970. To solve this issue and set a cookie without an expiration date, you can simply omit the expiration parameter or set it to null.

// Set a cookie without an expiration date
setcookie("cookie_name", "cookie_value", null, "/");