Bird
0
0

What does setting the expires parameter in setcookie() control?

easy📝 Conceptual Q11 of 15
PHP - Sessions and Cookies
What does setting the expires parameter in setcookie() control?
AHow long the cookie stays on the user's browser
BThe name of the cookie
CThe value stored inside the cookie
DThe domain where the cookie is valid
Step-by-Step Solution
Solution:
  1. Step 1: Understand the purpose of the expires parameter

    The expires parameter sets the time when the cookie will be deleted by the browser.
  2. Step 2: Relate expires to cookie lifetime

    Setting expires controls how long the cookie remains stored on the user's device.
  3. Final Answer:

    How long the cookie stays on the user's browser -> Option A
  4. Quick Check:

    Cookie expiration = lifetime on browser [OK]
Quick Trick: Expires means cookie lifetime in browser [OK]
Common Mistakes:
  • Confusing expires with cookie name or value
  • Thinking expires controls cookie content
  • Mixing expires with domain or path

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PHP Quizzes