������ ���������������� ������, ��� ������ ��� Cookies �� ����� ������������. �������������, Cookies �������� ������ ������ �������� ������������� ������������, ��� ���������� ��� ����� ���������� ��������� � ������ ������. �� ��� ��� ������, ���� ������������ � ���� � ���������� �������� ����� Cookies?
�� ���� ������ ������������ PHP ������������ � �������� ��������������� ������ �� � Cookies, � �����-������ ����������� �����, �������� ����� �������� ������ ��������.
�������: - ��������� ����������� � ����
� PHP ���������� ���� ����������� ��������� � ������ SID. ��� ������ �������� ��� ������ ������ � �� ������������� � ������� ���=�������������. ������ � ����� ������� ������ �����������, ����� ��� �������� �� Cookies ��������. ����� �������, ��� ���������� ������ �������� �������� ��������� SID � ��������, ����� �� "�������", ����� �� ������ ������ �� Cookies.
��� ������ ������������� ������ ��� Cookies:
<? session_name("testses"); session_start(); session_register("i"); $i=@$i+1; ?> <body> �� ������� ��� �������� <?=$i?> ���. ��� �������� �������� ������� ����������.<BR> <A href=sesclick.php?<?=SID?>>������� ��� ������ � �������!</A> </body>���� ������ ����� ��������, ���� � ������������ ������������� ��������� Cookies. ���� ��� ��������, PHP ������ �� ����� ������������ ��������� SID � ����������� Cookies.
�� � ����������� ������� ���� ���� ����������, � ������, ����� � ������� ���� ����� ��������� <?=SID?>, � ���� �� ����� ����������, �� ��������� ����� �� ��������!
� �������, ������������ PHP ���� ��� �����������, � ������ ������� ��� �� �����. ��-����� ���� � �����-������ ����������� �� �� ������ ���������� <?=SID?>, PHP ������� ��� �������������. ��� ���� �� �������� ��������� ���������, ������� ����� �������������� � URL.
��� �������� ����� ������������ ��������� ������:
<?session_start()?> <body> <A href="php.php">PHP</A> <A href="php.php?ss=1">PHP - ���������</A>��� ��� ����������, ��� ��������� ����� �� ��� ������:
https://www.spravkaweb.ru/php.php?PHPSESSID=81456f6a886f2104
https://www.spravkaweb.ru/php.php?ss=1&PHPSESSID=34f5d04a35601510f45
� PHP ���������� ��� ���� ����������� ������������ ������ � ������������ Cookies - ���������� ������ ����� � �����, ������� ��������� ��������, ����� �������� ������������� ������ ����������� ���������.
�������� ������, ������� �������� ��� �����������:
<?session_start()?> <form action=act.php mathod=post> </form>� ��� ��� ���������� ��� ��������� ����� �������� � ���� HTML:
<form action="act.php" method="post"> <INPUT TYPE=HIDDEN NAME="PHPSESSID" VALUE="0a561093f84d4321"> </form>�� ������� �� �����, ��� PHP ������� � ����� ������� ���� � ������ ������ � ���������.