PHP: Cookies - Manual
PHP  
downloads | documentation | faq | getting help | mailing lists | | php.net sites | links | my php.net 
search for in the  
<HTTP autentikace a PHPDealing with XForms>
view the version of this page
Last updated: Thu, 15 Jul 2004

Kapitola 18. Cookies

PHP transparentn� podporuje HTTP cookies. Cookies jsou mechanismem na ukl�d�n� dat ve vzd�len�m browseru a tud� sledov�n� nebo identifikaci vracej�c�ch se u�ivatel�. Cookies m��ete nastavovat pomoc� funkce setcookie(). Cookies jsou sou��st� HTTP hlavi�ky, tud� setcookie() se mus� volat p�ed odesl�n�m v�stupu do browseru. To je stejn� omezen�, jako m� funkce header().

V�echny cookies p�ijat� od klienta se automaticky st�vaj� PHP prom�nnou stejn� jako u GET a POST dat. Pokud chcete p�i�adit jednomu cookie v�ce hodnot, p�idejte [] na konec jm�na cookie. V�ce detail� viz funkce setcookie().



add a note add a note User Contributed Notes
Cookies
myfirstname at braincell dot cx
24-Sep-2003 03:47
[Editor's note: Wilson's comment has been deleted since it didn't contain much useful information, but this note is preserved although its reference is lost]

Just a general comment on Wilton's code snippet: It's generally considered very bad practice to store usernames and/or passwords in cookies, whether or not they're obsfucated.  Many spyware programs make a point of stealing cookie contents.

A much better solution would be to either use the PHP built in session handler or create something similar using your own cookie-based session ID.  This session ID could be tied to the source IP address or can be timed out as required but since the ID can be expired separately from the authentication criteria the authentication itself is not compromised.

Stuart Livings

<HTTP autentikace a PHPDealing with XForms>
 Last updated: Thu, 15 Jul 2004
show source | credits | sitemap | contact | advertising | mirror sites 
Copyright © 2001-2004 The PHP Group
All rights reserved.
This unofficial mirror is operated at: /
Last updated: Sun Nov 14 23:09:54 2004 Local time zone must be set--see zic manual page