Hello all,
I am using two separate setcookies to create and maintain cookies for every
day users and one for admins.
When a casual user hits a page I use this:
setcookie($bm[$i]['bm_pid'],$bm[$i]['bm_title'],time()+3153600 0,"/",".mydoma
in.com");
and an admin logs in it uses this:
setcookie("admi n","$admin",tim e()+7200);
The above created 2 different cookies, one for Cookie:user@myd omain.com/ and
one for Cookie:user@www .mydomain.com/
This way, later on I can call this to retrieve and show them what the have
"recently viewed":
foreach ($_COOKIE as $cookievalue) {
echo $cookievalue;
echo "<br>";
}
The problem is, it also reads in the stuff in the admin cookie. How can I
make it so that ONLY the casual users cookie information is read in ? I was
trying to avoid using sessions, and writing stuff to my db, etc.
I just wanted a quick and dirty way to have it remember certain pages that
were visited and show them (similar to amazon.com).
Many thanks.
I am using two separate setcookies to create and maintain cookies for every
day users and one for admins.
When a casual user hits a page I use this:
setcookie($bm[$i]['bm_pid'],$bm[$i]['bm_title'],time()+3153600 0,"/",".mydoma
in.com");
and an admin logs in it uses this:
setcookie("admi n","$admin",tim e()+7200);
The above created 2 different cookies, one for Cookie:user@myd omain.com/ and
one for Cookie:user@www .mydomain.com/
This way, later on I can call this to retrieve and show them what the have
"recently viewed":
foreach ($_COOKIE as $cookievalue) {
echo $cookievalue;
echo "<br>";
}
The problem is, it also reads in the stuff in the admin cookie. How can I
make it so that ONLY the casual users cookie information is read in ? I was
trying to avoid using sessions, and writing stuff to my db, etc.
I just wanted a quick and dirty way to have it remember certain pages that
were visited and show them (similar to amazon.com).
Many thanks.
Comment