Hello.
How to kill cookie?
I know that cookie can be deleted (must be deleted) with same parameters as they were set with it. And also other stuff about cookies (not visible until reloaded page, blah blah.)
I have IE5.0, on W2K, together with Apache2, PHP4. My cookie option in browser is set properly (do receive cookies), cookie do become visible, and I perfectly read value in it, but simply cannot kill it.
But.
I'm really having problems NOT only to delete cookie, but to set new value in it. Discusting!
Must say that I lost my patience.
Everything works fine with javascript but PHP solutions giving me a real headache as if I'm completely stupid.
If anyone can point me to an simple example that shows how to kill an set cookie, or to change its value, mui obligar!
Thanks in advance.
CODE THAT setcookie():
<?php
if (isset($_COOKIE['main_s']))
{
$main_s=$_COOKIE['main_s'];
}
else
{
/* one year cookie*/
setcookie ('main_s', '1 25 36 9001 1 0 0', 31536000);
$main_s=$_COOKIE['main_s'];
}
?>
CODE THAT READS IT:
<?
print '<pre>';
$aCValue= $_COOKIE;
print_r ($aCValue);
if(isset($_COOKIE_['direction_s'])) {
$direction_s=$_COOKIE['direction_s'];
}
if(isset($_COOKIE['main_s'])) {
$main_s=$_COOKIE['main_s'];
}
echo $main_s."<br>";
$a=explode(" ", $main_s);
echo $a[0]."<br>";
echo $a[1]."<br>";
echo $a[2]."<br>";
echo $a[3]."<br>";
echo $a[4]."<br>";
echo $a[5]."<br>";
echo $a[6]."<br>";
?>
KILLING COOKIE CODE:
<?php
setcookie ('main_s', '1 25 36 9001 1 0 0', -31536000);
?>
Tststs!
How to kill cookie?
I know that cookie can be deleted (must be deleted) with same parameters as they were set with it. And also other stuff about cookies (not visible until reloaded page, blah blah.)
I have IE5.0, on W2K, together with Apache2, PHP4. My cookie option in browser is set properly (do receive cookies), cookie do become visible, and I perfectly read value in it, but simply cannot kill it.
But.
I'm really having problems NOT only to delete cookie, but to set new value in it. Discusting!
Must say that I lost my patience.
Everything works fine with javascript but PHP solutions giving me a real headache as if I'm completely stupid.
If anyone can point me to an simple example that shows how to kill an set cookie, or to change its value, mui obligar!
Thanks in advance.
CODE THAT setcookie():
<?php
if (isset($_COOKIE['main_s']))
{
$main_s=$_COOKIE['main_s'];
}
else
{
/* one year cookie*/
setcookie ('main_s', '1 25 36 9001 1 0 0', 31536000);
$main_s=$_COOKIE['main_s'];
}
?>
CODE THAT READS IT:
<?
print '<pre>';
$aCValue= $_COOKIE;
print_r ($aCValue);
if(isset($_COOKIE_['direction_s'])) {
$direction_s=$_COOKIE['direction_s'];
}
if(isset($_COOKIE['main_s'])) {
$main_s=$_COOKIE['main_s'];
}
echo $main_s."<br>";
$a=explode(" ", $main_s);
echo $a[0]."<br>";
echo $a[1]."<br>";
echo $a[2]."<br>";
echo $a[3]."<br>";
echo $a[4]."<br>";
echo $a[5]."<br>";
echo $a[6]."<br>";
?>
KILLING COOKIE CODE:
<?php
setcookie ('main_s', '1 25 36 9001 1 0 0', -31536000);
?>
Tststs!