/**
     * Ensures appropriate legacy events are sent when migrating the session.
     *
     * {@inheritdoc}
     */
    public function regenerate( $destroy = false, $lifetime = null )
    {
        $oldSessionId = $this->getId();
        $success = $this->innerSessionStorage->regenerate( $destroy, $lifetime );
        $newSessionId = $this->getId();

        if ( $success )
        {
            $kernelClosure = $this->legacyKernelClosure;
            $kernelClosure()->runCallback(
                function () use ( $oldSessionId, $newSessionId )
                {
                    ezpEvent::getInstance()->notify( 'session/regenerate', array( $oldSessionId, $newSessionId ) );
                    $db = eZDB::instance();
                    $escOldKey = $db->escapeString( $oldSessionId );
                    $escNewKey = $db->escapeString( $newSessionId );
                    $escUserID = $db->escapeString( eZSession::userID() );
                    eZSession::triggerCallback( 'regenerate_pre', array( $db, $escNewKey, $escOldKey, $escUserID ) );
                    eZSession::triggerCallback( 'regenerate_post', array( $db, $escNewKey, $escOldKey, $escUserID ) );
                },
                false,
                false
            );
        }

        return $success;
    }
Beispiel #2
0
 /**
  * {@inheritdoc}
  */
 public function regenerate($destroy = false, $lifetime = null)
 {
     parent::regenerate($destroy);
 }