Bird
0
0

What is the primary purpose of cookies in PHP?

easy📝 Conceptual Q11 of 15
PHP - Sessions and Cookies
What is the primary purpose of cookies in PHP?
ATo execute server-side scripts
BTo style web pages dynamically
CTo create database connections
DTo store small pieces of data on the user's computer
Step-by-Step Solution
Solution:
  1. Step 1: Understand what cookies do

    Cookies save small data on the user's computer to remember information like preferences or login status.
  2. Step 2: Identify the correct purpose

    Among the options, only storing small data on the user's computer matches the purpose of cookies.
  3. Final Answer:

    To store small pieces of data on the user's computer -> Option D
  4. Quick Check:

    Cookies store data = B [OK]
Quick Trick: Cookies save data on user device, not server tasks [OK]
Common Mistakes:
  • Confusing cookies with server-side code execution
  • Thinking cookies style web pages
  • Assuming cookies manage database connections

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PHP Quizzes