<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://wbex.ru/index.php?action=history&amp;feed=atom&amp;title=PHP%2FCookie_Session%2F_COOKIE</id>
		<title>PHP/Cookie Session/ COOKIE - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://wbex.ru/index.php?action=history&amp;feed=atom&amp;title=PHP%2FCookie_Session%2F_COOKIE"/>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=PHP/Cookie_Session/_COOKIE&amp;action=history"/>
		<updated>2026-04-05T05:54:45Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://wbex.ru/index.php?title=PHP/Cookie_Session/_COOKIE&amp;diff=138&amp;oldid=prev</id>
		<title> в 10:37, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=PHP/Cookie_Session/_COOKIE&amp;diff=138&amp;oldid=prev"/>
				<updated>2010-05-26T10:37:32Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 10:37, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://wbex.ru/index.php?title=PHP/Cookie_Session/_COOKIE&amp;diff=139&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=PHP/Cookie_Session/_COOKIE&amp;diff=139&amp;oldid=prev"/>
				<updated>2010-05-26T07:01:35Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Checking for Cookie Support from PHP==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
    if(!isset($_GET[&amp;quot;testcookie&amp;quot;])) {&lt;br /&gt;
        setcookie(&amp;quot;testcookie&amp;quot;, &amp;quot;test value&amp;quot;);&lt;br /&gt;
        header(&amp;quot;Location:  {$_SERVER[&amp;quot;PHP_SELF&amp;quot;]}?testcookie=1&amp;quot;);&lt;br /&gt;
        exit;&lt;br /&gt;
    } else {&lt;br /&gt;
        if(isset($_COOKIE[&amp;quot;testcookie&amp;quot;])) {&lt;br /&gt;
            setcookie(&amp;quot;testcookie&amp;quot;);&lt;br /&gt;
            echo &amp;quot;You have cookies enabled&amp;quot;;&lt;br /&gt;
        } else {&lt;br /&gt;
            echo &amp;quot;You do not support cookies!&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Get Cookie Data==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $user  = $_COOKIE[&amp;quot;firstname&amp;quot;];&lt;br /&gt;
  $color = $_COOKIE[&amp;quot;fontcolor&amp;quot;];&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
 &amp;lt;head&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;title&amp;gt;Get Cookie Data&amp;lt;/title&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;style type = &amp;quot;text/css&amp;quot;&amp;gt;&lt;br /&gt;
   body { color: &amp;lt;?php echo( $color ); ?&amp;gt; }&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;/style&amp;gt;&lt;br /&gt;
 &amp;lt;/head&amp;gt;&lt;br /&gt;
 &amp;lt;body&amp;gt;&lt;br /&gt;
  &amp;lt;h1&amp;gt;Hello &amp;lt;?php echo( $user ); ?&amp;gt;! &amp;lt;/h1&amp;gt;&lt;br /&gt;
 &amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Printing a cookie value==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;?&lt;br /&gt;
print &amp;quot;Hello, &amp;quot; . $_COOKIE[&amp;quot;userid&amp;quot;];&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reading a cookie value==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
if (isset($_COOKIE[&amp;quot;flavor&amp;quot;])) {&lt;br /&gt;
    print &amp;quot;You ate a {$_COOKIE[&amp;quot;flavor&amp;quot;]} cookie.&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reading all cookie values==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
foreach ($_COOKIE as $cookie_name =&amp;gt; $cookie_value) {&lt;br /&gt;
    print &amp;quot;$cookie_name = $cookie_value &amp;lt;br/&amp;gt;&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Setting and Printing a Cookie Value==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
 setcookie( &amp;quot;vegetable&amp;quot;, &amp;quot;artichoke&amp;quot;, time()+3600, &amp;quot;/&amp;quot;,&amp;quot;wbex.ru&amp;quot;, 0 );&lt;br /&gt;
 ?&amp;gt;&lt;br /&gt;
 &amp;lt;html&amp;gt;&lt;br /&gt;
 &amp;lt;head&amp;gt;&lt;br /&gt;
 &amp;lt;title&amp;gt;Setting and Printing a Cookie Value&amp;lt;/title&amp;gt;&lt;br /&gt;
 &amp;lt;/head&amp;gt;&lt;br /&gt;
 &amp;lt;body&amp;gt;&lt;br /&gt;
 &amp;lt;?php&lt;br /&gt;
 if ( isset( $_COOKIE[&amp;quot;vegetable&amp;quot;] ) ) {&lt;br /&gt;
     print &amp;quot;&amp;lt;p&amp;gt;Hello again, your chosen vegetable is &amp;quot;;&lt;br /&gt;
     print &amp;quot;{$_COOKIE[&amp;quot;vegetable&amp;quot;]}&amp;lt;/p&amp;gt;&amp;quot;;&lt;br /&gt;
 } else {&lt;br /&gt;
     print &amp;quot;&amp;lt;p&amp;gt;Hello you. This may be your first visit&amp;lt;/p&amp;gt;&amp;quot;;&lt;br /&gt;
 }&lt;br /&gt;
 ?&amp;gt;&lt;br /&gt;
 &amp;lt;/body&amp;gt;&lt;br /&gt;
 &amp;lt;/html&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Still Logged In with cookie==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $auth = $_COOKIE[&amp;quot;auth&amp;quot;];&lt;br /&gt;
  header( &amp;quot;Cache-Control:no-cache&amp;quot; ); &lt;br /&gt;
  if( ! $auth == &amp;quot;ok&amp;quot; ) &lt;br /&gt;
  {&lt;br /&gt;
    header(&amp;quot;Location:login.php&amp;quot; );&lt;br /&gt;
    exit();&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
 &amp;lt;head&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;Still Logged In&amp;lt;/title&amp;gt;&lt;br /&gt;
 &amp;lt;/head&amp;gt;&lt;br /&gt;
 &amp;lt;body&amp;gt;&lt;br /&gt;
  You are still logged in ...&lt;br /&gt;
 &amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>