<<< Previous question <<< Question ID#0501.md >>> Next question >>>
What is the output of this script the third time it is loaded in a browser by the same user?
session_start();
if (!array_key_exists('counter', $_SESSION)) {
$_SESSION['counter'] = 0;
} else {
$_SESSION['counter']++;
}
session_regenerate_id();
echo $_SESSION['counter'];
- A) 2
- B) 1
- C) 3
- D) 0
Answer
Answer: A