PHP - Sessions and Cookies
What is the issue with this PHP code snippet?
echo $_SESSION['username']; session_start(); $_SESSION['username'] = 'Charlie';
echo $_SESSION['username']; session_start(); $_SESSION['username'] = 'Charlie';
session_start() must be called before accessing $_SESSION.$_SESSION['username'] before starting the session, which causes an error or empty output.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions