You are developing an e-commerce site and need to store and retrieve user cart data during their browsing session. Which PHP superglobal would be most appropriate for this use-case?

  • $_SESSION
  • $_COOKIE
  • $_POST
  • $_GET
The $_SESSION superglobal is ideal for storing user-specific data across multiple pages during a browsing session, making it suitable for cart data.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *