PHP - Sessions and Cookies
You want to set a cookie named
theme with value dark that expires in 7 days. Which code correctly sets this cookie?theme with value dark that expires in 7 days. Which code correctly sets this cookie?setcookie() should be current time plus 604800 seconds.time() + 7 * 24 * 60 * 60. setcookie('theme', 'dark', time() + 60); sets only 60 seconds, C uses 7 (invalid), D sets a past time (cookie expires immediately).15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions