phpcookiessetcookiehttpcookie

What does this cookie line mean? (time()+1*24*60*60;)


I have a php code that says this time for the cookie to expire What exactly does this mean?

time()+1*24*60*60;

Solution

  • As hinted to in the comments - that's a calculation of seconds from the current time. That's 1 day (86400 seconds).

    7 Days could be calculated similarly as:

    time() + (7 * 24 * 60 * 60);
    

    You can find a lot more explanation and examples in the PHP manual for the time() function - https://www.php.net/manual/en/function.time.php