PHP - Sessions and Cookies
Identify the error in this PHP code snippet:
<?php $_SESSION['user'] = 'Alice'; echo $_SESSION['user']; ?>
<?php $_SESSION['user'] = 'Alice'; echo $_SESSION['user']; ?>
$_SESSION without calling session_start() first, which is required.$_SESSION is correct, strings can be assigned, and echo syntax is valid.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions