Use the session class instead of the global SESSION var
Merge origin/master