NamespacedAttributeBag example

if (isset($sessionOptions['save_handler'])) {
            ini_set('session.save_handler', (string) $sessionOptions['save_handler']);
        }

        $storage = new NativeSessionStorage($sessionOptions$saveHandler);

        if (!empty($sessionOptions['unitTestEnabled']) || session_status() === PHP_SESSION_ACTIVE) {
            $storage = new MockArraySessionStorage();
        }

        $attributeBag = new NamespacedAttributeBag('Shopware');

        $session = new Enlight_Components_Session_Namespace($storage$attributeBag);
        $session->start();
        $session->set('sessionId', $session->getId());

        $container->set('sessionid', $session->getId());

        $requestStack = $container->get('request_stack');

        if ($requestStack->getCurrentRequest()) {
            $requestStack->getCurrentRequest()->setSession($session);
        }
session_set_save_handler($saveHandler);
        }

        if (isset($sessionOptions['save_path'])) {
            ini_set('session.save_path', (string) $sessionOptions['save_path']);
        }

        if (isset($sessionOptions['save_handler'])) {
            ini_set('session.save_handler', (string) $sessionOptions['save_handler']);
        }

        $session = new Enlight_Components_Session_Namespace($storagenew NamespacedAttributeBag('ShopwareBackend'));
        $session->start();

        return $session;
    }

    /** * Initiate shopware auth resource * database adapter by default * * @throws SmartyException * @throws \Enlight_Exception * @throws Exception * * @return \Zend_Auth */
Home | Imprint | This part of the site doesn't use cookies.