What potential issue can arise if the expiration time for a cookie in PHP is set in the past?

Setting the expiration time for a cookie in PHP to a past date will cause the cookie to be immediately deleted by the browser, making it inaccessible. To solve this issue, ensure that the expiration time is set to a future date/time.

// Set cookie with expiration time set to 1 hour from the current time
setcookie("example_cookie", "example_value", time() + 3600);