<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <parameter key="session.metadata.storage_key">_sf2_meta</parameter>
    </parameters>

    <services>
        <defaults public="false" />

        <service id="session" class="Symfony\Component\HttpFoundation\Session\Session" public="true">
            <argument type="service" id="session.storage" />
            <argument type="service" id="session.attribute_bag" />
            <argument type="service" id="session.flash_bag" />
        </service>

        <service id="Symfony\Component\HttpFoundation\Session\SessionInterface" alias="session" />
        <service id="Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface" alias="session.storage" />
        <service id="SessionHandlerInterface" alias="session.handler" />

        <service id="session.storage.metadata_bag" class="Symfony\Component\HttpFoundation\Session\Storage\MetadataBag">
            <argument>%session.metadata.storage_key%</argument>
            <argument>%session.metadata.update_threshold%</argument>
        </service>

        <service id="session.storage.native" class="Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage">
            <argument>%session.storage.options%</argument>
            <argument type="service" id="session.handler" />
            <argument type="service" id="session.storage.metadata_bag" />
        </service>

        <service id="session.storage.php_bridge" class="Symfony\Component\HttpFoundation\Session\Storage\PhpBridgeSessionStorage">
            <argument type="service" id="session.handler" />
            <argument type="service" id="session.storage.metadata_bag" />
        </service>

        <service id="session.flash_bag" class="Symfony\Component\HttpFoundation\Session\Flash\FlashBag" />
        <service id="Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface" alias="session.flash_bag" />

        <service id="session.attribute_bag" class="Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag" />

        <service id="session.storage.mock_file" class="Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage">
            <argument>%kernel.cache_dir%/sessions</argument>
            <argument>MOCKSESSID</argument>
            <argument type="service" id="session.storage.metadata_bag" />
        </service>

        <service id="session.handler.native_file" class="Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandler">
            <argument type="service">
                <service class="Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler">
                    <argument>%session.save_path%</argument>
                </service>
            </argument>
        </service>

        <service id="session.handler.write_check" class="Symfony\Component\HttpFoundation\Session\Storage\Handler\WriteCheckSessionHandler">
            <deprecated>The "%service_id%" service is deprecated since Symfony 3.4 and will be removed in 4.0. Use the `session.lazy_write` ini setting instead.</deprecated>
        </service>

        <service id="session_listener" class="Symfony\Component\HttpKernel\EventListener\SessionListener">
            <tag name="kernel.event_subscriber" />
            <argument type="service">
                <service class="Symfony\Component\DependencyInjection\ServiceLocator">
                    <tag name="container.service_locator" />
                    <argument type="collection">
                        <argument key="session" type="service" id="session" on-invalid="ignore" />
                    </argument>
                </service>
            </argument>
        </service>

        <service id="session.save_listener" class="Symfony\Component\HttpKernel\EventListener\SaveSessionListener">
            <tag name="kernel.event_subscriber" />
        </service>

        <!-- for BC -->
        <service id="session.storage.filesystem" alias="session.storage.mock_file" />
    </services>
</container>
