<?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" />
        </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">
            <factory service="session" method="getFlashBag"/>
        </service>
        <service id="Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface" alias="session.flash_bag" />

        <service id="session.attribute_bag" class="Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag">
            <factory service="session" method="getBag"/>
            <argument>attributes</argument>
        </service>

        <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.abstract_handler" class="Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler">
            <factory class="Symfony\Component\HttpFoundation\Session\Storage\Handler\SessionHandlerFactory" method="createHandler" />
            <argument />
        </service>

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

        <service id="session.save_listener" class="Symfony\Component\HttpKernel\EventListener\SaveSessionListener">
            <deprecated>The "%service_id%" service is deprecated since Symfony 4.1. Use the "session_listener" service instead.</deprecated>
        </service>

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