<?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 http://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <parameter key="session.class">Symfony\Component\HttpFoundation\Session\Session</parameter>
        <parameter key="session.flashbag.class">Symfony\Component\HttpFoundation\Session\Flash\FlashBag</parameter>
        <parameter key="session.attribute_bag.class">Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag</parameter>
        <parameter key="session.storage.metadata_bag.class">Symfony\Component\HttpFoundation\Session\Storage\MetadataBag</parameter>
        <parameter key="session.metadata.storage_key">_sf2_meta</parameter>
        <parameter key="session.storage.native.class">Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage</parameter>
        <parameter key="session.storage.php_bridge.class">Symfony\Component\HttpFoundation\Session\Storage\PhpBridgeSessionStorage</parameter>
        <parameter key="session.storage.mock_file.class">Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage</parameter>
        <parameter key="session.handler.native_file.class">Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler</parameter>
        <parameter key="session.handler.write_check.class">Symfony\Component\HttpFoundation\Session\Storage\Handler\WriteCheckSessionHandler</parameter>
        <parameter key="session_listener.class">Symfony\Bundle\FrameworkBundle\EventListener\SessionListener</parameter>
    </parameters>

    <services>
        <service id="session" class="%session.class%">
            <argument type="service" id="session.storage" />
            <argument type="service" id="session.attribute_bag" />
            <argument type="service" id="session.flash_bag" />
        </service>

        <service id="session.storage.metadata_bag" class="%session.storage.metadata_bag.class%" public="false">
            <argument>%session.metadata.storage_key%</argument>
            <argument>%session.metadata.update_threshold%</argument>
        </service>

        <service id="session.storage.native" class="%session.storage.native.class%">
            <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="%session.storage.php_bridge.class%">
            <argument type="service" id="session.handler" />
            <argument type="service" id="session.storage.metadata_bag" />
        </service>

        <service id="session.flash_bag" class="%session.flashbag.class%" public="false" />

        <service id="session.attribute_bag" class="%session.attribute_bag.class%" public="false" />

        <service id="session.storage.mock_file" class="%session.storage.mock_file.class%" public="false">
            <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="%session.handler.native_file.class%" public="false">
            <argument>%session.save_path%</argument>
        </service>

        <service id="session.handler.write_check" class="%session.handler.write_check.class%" public="false" />

        <service id="session_listener" class="%session_listener.class%">
            <tag name="kernel.event_subscriber" />
            <argument type="service" id="service_container" />
        </service>

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