<?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect1 id="zend.http.user-agent-storage-session">
    <title>The Session UserAgent Storage Adapter</title>

    <sect2 id="zend.http.user-agent-storage-session.intro">
        <title>Overview</title>

        <para>
            This <link linkend="zend.http.user-agent-storage">storage adapter</link> utilizes
            <classname>Zend_Session_Namespace</classname> for persisting discovered device
            capabilities for a given user session.
        </para>
    </sect2>

    <sect2 id="zend.http.user-agent-storage-session.quick-start">
        <title>Quick Start</title>

        <para>
            This particular storage adapter is used by default with
            <classname>Zend_Http_UserAgent</classname>. As such, you will benefit from it from the
            outset without any real configuration necessary.
        </para>

        <para>
            You can alter the behavior slightly, however, by altering the namespace used, and the
            key (or <emphasis>member</emphasis>) in which data is written. You may do so by
            specifying the <varname>browser_type</varname> (mapped to namespace) and
            <varname>member</varname> options in your configuration.
        </para>

        <programlisting language="ini"><![CDATA[
resources.useragent.storage.adapter = "Session"
resources.useragent.storage.options.browser_type = "all"
resources.useragent.storage.options.member = "data"
]]></programlisting>

        <para>
            Typically, you will not pass the <varname>browser_type</varname> option, and instead let
            this be populated by the value discovered by the <classname>UserAgent</classname> class.
        </para>
    </sect2>

    <sect2 id="zend.http.user-agent-storage-session.options">
        <title>Configuration Options</title>

        <variablelist>
            <title>Session Storage Options</title>

            <varlistentry>
                <term>browser_type</term>

                <listitem>
                    <para>
                        Provide this in order to hardcode the session namespace in which you wish to
                        store the User-Agent data. By default, the currently discovered browser type
                        will be used, or, if not provided, the value "Zend_Http_UserAgent".
                    </para>
                </listitem>
            </varlistentry>

            <varlistentry>
                <term>member</term>

                <listitem>
                    <para>
                        This is the specific variable member within the session namespace in which
                        the data will be stored. By default, the value "storage" will be used.
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </sect2>

    <sect2 id="zend.http.user-agent-storage-session.methods">
        <title>Available Methods</title>

        <variablelist>
            <varlistentry id="zend.http.user-agent-storage-session.methods.constructor">
                <term>
                    <methodsynopsis>
                        <methodname>__construct</methodname>
                        <methodparam>
                            <funcparams>$options = null</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>

                <listitem>
                    <para>
                        Accepts an array or object containing options. See the <link
                            linkend="zend.http.user-agent-storage-session.options">configuration options
                            section</link> for details on the <varname>$options</varname> variable.
                    </para>
                </listitem>
            </varlistentry>

            <varlistentry id="zend.http.user-agent-storage-session.methods.is-empty">
                <term>
                    <methodsynopsis>
                        <methodname>isEmpty</methodname>
                    </methodsynopsis>
                </term>

                <listitem>
                    <para>
                        Used to determine whether or not the storage has been populated yet.
                    </para>
                </listitem>
            </varlistentry>

            <varlistentry id="zend.http.user-agent-storage-session.methods.read">
                <term>
                    <methodsynopsis>
                        <methodname>read</methodname>
                    </methodsynopsis>
                </term>

                <listitem>
                    <para>
                        Retrieve previously stored data from the storage adapter.
                    </para>
                </listitem>
            </varlistentry>

            <varlistentry id="zend.http.user-agent-storage-session.methods.write">
                <term>
                    <methodsynopsis>
                        <methodname>write</methodname>
                        <methodparam>
                            <funcparams>$contents</funcparams>
                        </methodparam>
                    </methodsynopsis>
                </term>

                <listitem>
                    <para>
                        Write data to the storage adapter for later retrieval.
                        <varname>$contents</varname> should be a string containing the serialized
                        <classname>UserAgent</classname> object.
                    </para>
                </listitem>
            </varlistentry>

            <varlistentry id="zend.http.user-agent-storage-session.methods.clear">
                <term>
                    <methodsynopsis>
                        <methodname>clear</methodname>
                    </methodsynopsis>
                </term>

                <listitem>
                    <para>
                        Clear the storage of any data.
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </sect2>
</sect1>
