Which superglobal should be used in PHP to access session variables?
- $_COOKIE
- $_GET
- $_SESSION
- $_GLOBALS
In PHP, the $_SESSION superglobal is used to access and manipulate session variables. Session variables store user-specific data throughout a user's interaction with the web application.
Loading...
Related Quiz
- How are variables in PHP declared?
- What does accessing a class via :: mean?
- An example of a superglobal in PHP is $_POST, which is used to collect form data sent with the ______ method.
- You are writing a PHP script and you need to access the user's IP address. How would you do this using the $_SERVER superglobal?
- The PHP function used to split an array into chunks of new arrays with specified size is ________.