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.
Loading...
Related Quiz
- In PHP, both echo and print can output strings, variables, and HTML code.
- You need to execute a block of code at least once in your PHP script, then repeat it as long as a certain condition is true. Which type of loop would you use and why?
- What can be the potential issues with a foreach loop in PHP?
- The PHP interpreter executes comments as part of the script.
- How do you define an abstract class in PHP?