Create
<?php
$cookie_name
= 'pontikis_net_php_cookie';
$cookie_value
= 'test_cookie_set_with_php';
setcookie($cookie_name,
$cookie_value, time() + (86400 * 30), '/'); // 86400 = 1 day
?>
Read
<?php
$cookie_name
= 'pontikis_net_php_cookie';
<span
class="h10395431"
id="h10395431_17">if</span>(!isset($_COOKIE[$cookie_name]))
{
print
'Cookie with name "' . $cookie_name . '" does not
exist...';
}
else {
print
'Cookie with name "' . $cookie_name . '" value is: ' .
$_COOKIE[$cookie_name];
}
?>
Update
<?php
$cookie_name
= 'pontikis_net_php_cookie';
$cookie_value
= 'test_cookie_updated_with_php';
setcookie($cookie_name,
$cookie_value, time() + (86400 * 30), '/'); // 86400 = 1 day
?>
No comments:
Post a Comment