Bird
0
0

How can you modify PHP configuration to exclude cookies from $_REQUEST?

hard📝 Application Q9 of 15
PHP - Superglobals and Web Context
How can you modify PHP configuration to exclude cookies from $_REQUEST?
ASet <code>variables_order = "G P"</code> in php.ini
BSet <code>request_order = "GP"</code> in php.ini
CUnset <code>$_COOKIE</code> in the script
DSet <code>variables_order = "C"</code> in php.ini
Step-by-Step Solution
Solution:
  1. Step 1: Understand variables_order vs request_order

    variables_order controls which superglobals are created. request_order controls which variables populate $_REQUEST.
  2. Step 2: Exclude cookies from $_REQUEST

    Setting request_order = "GP" excludes cookies from $_REQUEST.
  3. Final Answer:

    Set request_order = "GP" in php.ini -> Option B
  4. Quick Check:

    Use request_order to control $_REQUEST contents [OK]
Quick Trick: Use request_order to exclude cookies from $_REQUEST [OK]
Common Mistakes:
  • Confusing variables_order with request_order
  • Trying to unset $_COOKIE to affect $_REQUEST

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PHP Quizzes