CONTRIB-4856 :: Session variable can be empty when accessed causing PHP warning

Signed-off-by: Joseph Rézeau <moodle@rezeau.org>