php-doc-en/reference/http/functions/parsers/http-parse-cookie.xml
Daniel Egeberg 96c9d88bad Converted to utf-8
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@297028 c90b9560-bf6c-de11-be94-00142212c4b1
2010-03-28 22:10:10 +00:00

168 lines
3.9 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- Generated by xml_proto.php v2.4. Found in /scripts directory of phpdoc. -->
<refentry xml:id="function.http-parse-cookie" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>http_parse_cookie</refname>
<refpurpose>Parse HTTP cookie</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>object</type><methodname>http_parse_cookie</methodname>
<methodparam><type>string</type><parameter>cookie</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>allowed_extras</parameter></methodparam>
</methodsynopsis>
<para>
Parses HTTP cookies like sent in a response into a struct.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>cookie</parameter></term>
<listitem>
<para>
string containing the value of a <literal>Set-Cookie</literal> response header
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>flags</parameter></term>
<listitem>
<para>
parse flags (<link linkend="http.constants.cookie"><constant>HTTP_COOKIE_PARSE_RAW</constant></link>)
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>allowed_extras</parameter></term>
<listitem>
<para>
array containing recognized <emphasis>extra</emphasis> keys;
by default all unknown keys will be treated as cookie names
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a stdClass object on success&return.falseforfailure;.
</para>
</refsect1>
<!-- Use when ERRORS exist
<refsect1 role="errors">
&reftitle.errors;
<para>
When does this function throw E_* level errors, or exceptions?
</para>
</refsect1>
-->
<!-- Use when a CHANGELOG exists
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>Enter the PHP version of change here</entry>
<entry>Description of change</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
-->
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Using <function>http_parse_cookie</function></title>
<programlisting role="php">
<![CDATA[
<?php
print_r(http_parse_cookie("foo=bar; bar=baz; path=/; domain=example.com; comment=; secure", 0, array("comment")));
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
stdClass Object
(
[cookies] => Array
(
[foo] => bar
[bar] => baz
)
[extras] => Array
(
[comment] =>
)
[flags] => 16
[expires] => 0
[path] => /
[domain] => example.com
)
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>http_parse_headers</function></member>
<member><function>http_parse_message</function></member>
<member><function>http_build_cookie</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->