Fix undefined $_SESSION error when calling Session::check

If you call session::check() before a session has been started you get a undefined variable $_SESSION error.
Merge pull request #3556 from dakota/patch-2

Fix undefined $_SESSION error when calling Session::check