setcookie.xml

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@116906 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Friedhelm Betz 2003-02-18 11:08:29 +00:00
parent bc23576f99
commit 89c906c1db

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.19 $ -->
<!-- $Revision: 1.20 $ -->
<!-- splitted from ./en/functions/http.xml, last change in rev 1.2 -->
<refentry id="function.setcookie">
<refnamediv>
@ -41,16 +41,14 @@
</note>
<para>
All the arguments except the <parameter>name</parameter> argument
are optional. If only the name argument is present, the cookie
by that name will be deleted from the remote client. You may
also replace an argument with an empty string
are optional. You may also replace an argument with an empty string
(<emphasis>&quot;&quot;</emphasis>) in order to skip that
argument. Because the <parameter>expire</parameter> and
argument. Because the <parameter>expire</parameter> and
<parameter>secure</parameter> arguments are integers, they cannot
be skipped with an empty string, use a zero (<emphasis>0</emphasis>)
be skipped with an empty string, use a zero (<emphasis>0</emphasis>)
instead. The following table explains each parameter of the
<function>setcookie</function> function, be sure to read the
<ulink url="&spec.cookies;">Netscape cookie specification</ulink>
<ulink url="&spec.cookies;">Netscape cookie specification</ulink>
for specifics.
</para>
<para>
@ -181,6 +179,9 @@
<listitem>
<simpara>
Cookies must be deleted with the same parameters as they were set with.
If the value argument is an empty string (""), and all other arguments
match a previous call to setcookie, then the cookie with the specified
name will be deleted from the remote client.
</simpara>
</listitem>
<listitem>
@ -262,7 +263,8 @@ setcookie ("TestCookie", "", time() - 3600, "/~rasmus/", ".example.com", 1);
you have array elements, but when the cookie is received by your
script, the values are all placed in an array with the cookie's
name:
<informalexample>
<example>
<title><function>setcookie</function> and arrays</title>
<programlisting role="php">
<![CDATA[
<?php
@ -288,7 +290,7 @@ one : cookieone
?>
]]>
</programlisting>
</informalexample>
</example>
</para>
<para>
For more information on cookies, see Netscape's cookie