/** * function to get the instantiated session object or * create a new one (singleton pattern) */ public static function getInstance() { if (!isset(self::$_instance)) { self::$_instance = new self(); } self::$_instance->startSession(); return self::$_instance; }