static public function getHandlerInstance( ezpSessionHandler $handler = null )
    {
        if ( self::$handlerInstance === null )
        {
            if ( $handler === null )
            {
                $ini = eZINI::instance();
                if ( $ini->variable( 'Session', 'Handler' ) !== '' )
                {
                    $optionArray = array(
                        'iniFile'       => 'site.ini',
                        'iniSection'    => 'Session',
                        'iniVariable'   => 'Handler',
                        'handlerParams' => array( self::$hasSessionCookie )
                    );

                    $options = new ezpExtensionOptions( $optionArray );
                    self::$handlerInstance = eZExtension::getHandlerClass( $options );
                }
            }
            else
            {
                self::$handlerInstance = $handler;
            }
            if ( !self::$handlerInstance instanceof ezpSessionHandler )
            {
                self::$handlerInstance = new ezpSessionHandlerPHP( self::$hasSessionCookie );
            }
        }
        return self::$handlerInstance;
    }