diff --git a/features/cookies.xml b/features/cookies.xml index f2349796da..47fac1d1ca 100644 --- a/features/cookies.xml +++ b/features/cookies.xml @@ -1,12 +1,13 @@ - + Cookies PHP transparently supports HTTP cookies. Cookies are a mechanism for storing data in the remote browser and thus tracking or identifying return - users. You can set cookies using the setcookie + users. You can set cookies using the setcookie or + setrawcookie function. Cookies are part of the HTTP header, so setcookie must be called before any output is sent to the browser. This is the same limitation that header @@ -33,7 +34,8 @@ For more details, including notes on browser bugs, see the - setcookie function. + setcookie and setrawcookie + function. diff --git a/reference/http/functions/setcookie.xml b/reference/http/functions/setcookie.xml index de23e765c3..96beece377 100644 --- a/reference/http/functions/setcookie.xml +++ b/reference/http/functions/setcookie.xml @@ -1,5 +1,5 @@ - + @@ -225,8 +225,10 @@ setcookie("TestCookie", $value, time()+3600, "/~rasmus/", ".example.com", 1); Note that the value portion of the cookie will automatically be urlencoded when you send the cookie, and when it is received, it is automatically decoded and assigned to a variable by the same - name as the cookie name. To see the contents of our test - cookie in a script, simply use one of the following examples: + name as the cookie name. If you don't want this, you can use + setrawcookie instead if you are using PHP 5. To see + the contents of our test cookie in a script, simply use one of the + following examples: @@ -329,8 +331,8 @@ one : cookieone - See also header and the - cookies section. + See also header, setrawcookie + and the cookies section. diff --git a/reference/http/functions/setrawcookie.xml b/reference/http/functions/setrawcookie.xml new file mode 100644 index 0000000000..1e468e333f --- /dev/null +++ b/reference/http/functions/setrawcookie.xml @@ -0,0 +1,51 @@ + + + + + + setrawcookie + Send a cookie without urlencoding the cookie value + + + Description + + boolsetrawcookie + stringname + stringvalue + intexpire + stringpath + stringdomain + intsecure + + + setrawcookie is exactly the same as + setcookie except that the cookie value will not + automaticall be urlencoded when send to the browser. + + + See also header, setcookie and the + cookies section. + + + + +