Fixed issue to check if user is logged in instead of trying to get a null session item