Additional fixes for PHP error regarding session checking