<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect2 id="zend.application.available-resources.session">
    <title>Zend_Application_Resource_Session</title>

    <para>
        <classname>Zend_Application_Resource_Session</classname> allows you to configure
        <classname>Zend_Session</classname> as well as optionally initialize a session
        SaveHandler.
    </para>

    <para>
        To set a session save handler, simply pass the <code>saveHandler</code>
        (case insensitive) option key to the resource. The value of this option
        may be one of the following:
    </para>

    <itemizedlist>
        <listitem><para>
            <code>string</code>: A string indicating a class implementing
            <classname>Zend_Session_SaveHandler_Interface</classname> that should be
            instantiated.
        </para></listitem>

        <listitem><para>
            <code>array</code>: An array with the keys "class" and, optionally,
            "options", indicating a class implementing
            <classname>Zend_Session_SaveHandler_Interface</classname> that should be
            instantiated and an array of options to provide to its constructor.
        </para></listitem>

        <listitem><para>
            <classname>Zend_Session_SaveHandler_Interface</classname>: an object
            implementing this interface.
        </para></listitem>
    </itemizedlist>

    <para>
        Any other option keys passed will be passed to
        <classname>Zend_Session::setOptions()</classname> to configure
        <classname>Zend_Session</classname>.
    </para>

    <example id="zend.application.available-resources.session.configExample">
        <title>Sample Session resource configuration</title>

        <para>
            Below is a sample INI snippet showing how to configure the session
            resource. It sets several <classname>Zend_Session</classname> options, as well
            as configures a <classname>Zend_Session_SaveHandler_Db</classname> instance.
        </para>

        <programlisting role="ini"><![CDATA[
resources.session.save_path = APPLICATION_PATH "/../data/session"
resources.session.use_only_cookies = true
resources.session.remember_me_seconds = 864000
resources.session.saveHandler.class = "Zend_Session_SaveHandler_Db"
resources.session.saveHandler.options.name = "session"
resources.session.saveHandler.options.primary.session_id = "session_id"
resources.session.saveHandler.options.primary.save_path = "save_path"
resources.session.saveHandler.options.primary.name = "name"
resources.session.saveHandler.options.primaryAssignment.sessionId = "sessionId"
resources.session.saveHandler.options.primaryAssignment.sessionSavePath = "sessionSavePath"
resources.session.saveHandler.options.primaryAssignment.sessionName = "sessionName"
resources.session.saveHandler.options.modifiedColumn = "modified"
resources.session.saveHandler.options.dataColumn = "session_data"
resources.session.saveHandler.options.lifetimeColumn = "lifetime"
]]></programlisting>
    </example>
</sect2>
<commit_msg>ZF-6470: fix typos in Session resource docs, and add note about initializing Db resource<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect2 id="zend.application.available-resources.session">
    <title>Zend_Application_Resource_Session</title>

    <para>
        <classname>Zend_Application_Resource_Session</classname> allows you to configure
        <classname>Zend_Session</classname> as well as optionally initialize a session
        SaveHandler.
    </para>

    <para>
        To set a session save handler, simply pass the <code>saveHandler</code>
        (case insensitive) option key to the resource. The value of this option
        may be one of the following:
    </para>

    <itemizedlist>
        <listitem><para>
            <code>string</code>: A string indicating a class implementing
            <classname>Zend_Session_SaveHandler_Interface</classname> that should be
            instantiated.
        </para></listitem>

        <listitem><para>
            <code>array</code>: An array with the keys "class" and, optionally,
            "options", indicating a class implementing
            <classname>Zend_Session_SaveHandler_Interface</classname> that should be
            instantiated and an array of options to provide to its constructor.
        </para></listitem>

        <listitem><para>
            <classname>Zend_Session_SaveHandler_Interface</classname>: an object
            implementing this interface.
        </para></listitem>
    </itemizedlist>

    <para>
        Any other option keys passed will be passed to
        <classname>Zend_Session::setOptions()</classname> to configure
        <classname>Zend_Session</classname>.
    </para>

    <example id="zend.application.available-resources.session.configExample">
        <title>Sample Session resource configuration</title>

        <para>
            Below is a sample INI snippet showing how to configure the session
            resource. It sets several <classname>Zend_Session</classname> options, as well
            as configures a <classname>Zend_Session_SaveHandler_DbTable</classname> instance.
        </para>

        <programlisting role="ini"><![CDATA[
resources.session.save_path = APPLICATION_PATH "/../data/session"
resources.session.use_only_cookies = true
resources.session.remember_me_seconds = 864000
resources.session.saveHandler.class = "Zend_Session_SaveHandler_DbTable"
resources.session.saveHandler.options.name = "session"
resources.session.saveHandler.options.primary.session_id = "session_id"
resources.session.saveHandler.options.primary.save_path = "save_path"
resources.session.saveHandler.options.primary.name = "name"
resources.session.saveHandler.options.primaryAssignment.sessionId = "sessionId"
resources.session.saveHandler.options.primaryAssignment.sessionSavePath = "sessionSavePath"
resources.session.saveHandler.options.primaryAssignment.sessionName = "sessionName"
resources.session.saveHandler.options.modifiedColumn = "modified"
resources.session.saveHandler.options.dataColumn = "session_data"
resources.session.saveHandler.options.lifetimeColumn = "lifetime"
]]></programlisting>
    </example>

    <note>
        <title>Bootstrap your database first!</title>

        <para>
            If you are configuring the
            <classname>Zend_Session_SaveHandler_DbTable</classname> session save
            handler, you must first configure your database connection for it to
            work. Do this by either using the <link
                linkend="zend.application.available-resources.db">Db</link>
            resource -- and make sure the "resources.db" key comes prior to the
            "resources.session" key -- or by writing your own resource that
            initializes the database, and specifically sets the default
            <classname>Zend_Db_Table</classname> adapter.
        </para>
    </note>
</sect2>

{'fraction_non_alphanumeric': 0.09723015419760137, 'fraction_numerical': 0.0037121644774414622, 'mean_word_length': 3.430740037950664, 'pattern_counts': {'":': 0, '<': 133, '<?xml version=': 2, '>': 133, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5835510', 'n_tokens_mistral': 1889, 'n_tokens_neox': 1841, 'n_words': 461}