replace $_SESSION superglobal with $SESSION

Viewed 13

do we still have to replace $_SESSION php superglobal by Moodle global called $SESSION or not ?

$_SESSION -> $SESSION
1 Answers

You certainly shouldn't be "replacing" / overwriting the $_SESSION global with the value of $SESSION, because that would wipe out a whole lot of data used by Moodle.

If your question is, should be be using $SESSION in Moodle, instead of the PHP $_SESSION superglobal, then the answer is definitely yes (because Moodle is using $_SESSION and you don't want to be getting in the way of that).

Related