PHP - Sessions and Cookies
Identify the error in this PHP code snippet:
<?php $_SESSION['user'] = 'John'; session_start(); echo $_SESSION['user']; ?>
<?php $_SESSION['user'] = 'John'; session_start(); echo $_SESSION['user']; ?>
$_SESSION variables.$_SESSION['user'] is set before session_start(), so session data is not properly initialized.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions