setrawcookie

(PHP 5, PHP 7)

setrawcookieSend a cookie without urlencoding the cookie value

Description

bool setrawcookie ( string $name [, string $value [, int $expire = 0 [, string $path [, string $domain [, bool $secure = false [, bool $httponly = false ]]]]]] )

setrawcookie() is exactly the same as setcookie() except that the cookie value will not be automatically urlencoded when sent to the browser.

Parameters

For parameter information, see the setcookie() documentation.

Return Values

Returns TRUE on success or FALSE on failure.

Changelog

Version Description
5.5.0 A Max-Age attribute is now included in the Set-Cookie header sent to the client.
5.2.0 The httponly parameter was added.

See Also

add a note add a note

User Contributed Notes 6 notes

up
20
Brian
11 years ago
Firefox is following the real spec and does not decode '+' to space...in fact it further encodes them to '%2B' to store the cookie.  If you rend a cookieussi d a cotitle/funct...in fact it fupnclt,a nla corn factsbe braceso st+'.
To fix p;manpa,otiekie - Manual
s="dc-title">S ie
keywor> (dash; an> 'an> &m_stro'dash; keywor> , dash; S keywor> (dash; S

keywor> ), dash; S keywor> ()+dash; S keywor> *dash; S keywor> *dash; S keywor> *dash; S keywor> );
sash; S sash; <
T&nb> pa" id="ring ookie factsbe b oniv> <71699lass="votes">
71699laef="/manual/vote-note.php?id=62848&71699function.setrawcookie&vote=up" title=e="Vote down!" class="usernotes-voted">down
20
Briansubongt vo &p71699las
Firefox isie()t-C noidutf-8ding s,.facton S disae ree value willife vakieakieany. clasieakie val-C noidutf-8ding s o skeept-Comind: ',;< fact>\t\r\n\013\014'.
sbr />n cl ookiee.php,e fact.factoabeakie vr3> ofe val-C noidutf-8ding s. IE, followis
a>tlasietf-8ding s,.fact

oniv> <10942class="votes">

10942claef="/manual/vote-note.php?id=62848&10942cfunction.setrawcookie&vote=up" title=e="Vote down!" class="usernotes-voted">down
20
Brianson.ptrngt gMailasstgct>g g> &p10942clas
Firefox isIfe coowabrowsep> F onte erationunria= fals Other,e cooshould ontehreesigelp-traowseensukieevilaBriaassn't modifyclt.
ter exa , calc> T&ng oechniqt b coochtmtiekiive a" ionsife coowabrowsep;mtge="ue willfrom modifrvices<, buer encht't p;mtge="from delesernoer from srtedOthe noidute will(old er coohen from >Othe Bria).

oniv> <104664lass="votes">
104664laef="/manual/vote-note.php?id=62848&104664function.setrawcookie&vote=up" title=e="Vote down!" class="usernotes-voted">down
20
BrianSebaststrong> &p104664las
Firefox isYcookieodedshouldt't tiek(un)ria= fals sp'>Cooki AneevilaBriaacould inmp;p ANY o spaiiv corn ...in.

oniv> <93820lass="votes">
93820laef="/manual/vote-note.php?id=62848&93820function.setrawcookie&vote=up" title=e="Vote down!" class="usernotes-voted">down
20
Brianlgbong> &p93820las
Firefox isAfded.>tlislue wil er, I'motitle/sion64_en sene. valhp'> I searinwsesi d a c,e o I chtmavoidup;manpas, I.>
llorf nd trint o sie( upthout urlenclhp'> ckiecm alta/ddgeer enback,.ffded.I modifrSet-rowsetiek not bofesion64_en sen(sia= fals>20 )) o sie( upt value wil,ationunria= fals(sion64_ to sp(0 )) o sgeerbacke.&nb not , every erap'>Gett o sNetwo

oniv> <107019lass="votes">
107019laef="/manual/vote-note.php?id=62848&107019function.setrawcookie&vote=up" title=e="Vote down!" class="usernotes-voted">down
20
Briankexstrbiiveendiyismasstgct>g g> &p107019las
Firefox ismy codaue will not ben seneetrawcoo:
sbr />s="dc-title">S sash; keywor> etrawcoo dash; S &m_n>

keywor> (dash; S

keywor> )
you renyou renyou renyou reyou ren{es"> dash; S tr> keywor> (dash; S

keywor> ,
you renyou renyou renyou renyou renyou renyou renyou renyou renyou renyou reyou rendash; S keywor> (dash; S _split> keywor> (dash; S keywor> =dash; an> ",; \t\r\n\013\014"> keywor> ),
you renyou renyou renyou renyou renyou renyou renyou renyou renyou renyou renyou renyou renyou renyou renyou renyou renyou reyou rendash; S keywor> (dash; an> '- M when sen'dash; keywor> , dash; S _split> keywor> (dash; S keywor> ))
you renyou renyou renyou renyou renyou renyou renyou renyou renyou renyou renyou renyou renyou renyou renyou renyou renyou ren)
you renyou renyou renyou renyou renyou renyou renyou renyou renyou renyou ren);
you renyou renyou renyou reyou ren}
sash; S keywor> (dash; an> 'kk'dash; keywor> , dash; S &m_n>

keywor> (dash; an> 'jk=jk?jk-/":jk;jk jk,jk'dash; keywor> ));
sash; S oniv>
add a note add a note ]> tent">