Home » PHP » PHP Sessions » Question
  1. Which one of the following statements should you use to set the session username to Manjesh?
    1. session_start(“Manjesh”);
    2. $SESSION_START[“username”] = “Manjesh”;
    3. $SESSION[‘username’] = “Manjesh”;
    4. $_SESSION[‘username’] = “Manjesh”;
    5. None of these
Correct Option: D

You need to refer the session variable ‘username’ in the context of the $_SESSION superglobal.



Your comments will be displayed only after manual approval.