How can you modify the lifetime of a cookie in PHP?

  • By setting the expires attribute in setcookie() function with a future timestamp.
  • By using session_set_cookie_params()
  • By directly modifying the cookie file.
  • By changing the cookie name.
To modify the lifetime of a cookie in PHP, you can set the expires attribute in the setcookie() function with a future timestamp. This specifies when the cookie should expire.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *