cookie issues

message from msa on 21 Jul 2004
I am trying to put my brain around cookies (php/mysql) and thought I had
it, but pages aren't responding as planned.

I am using cookies to define access levels. when the user logs in they are
access level 1 or 2. There are several pages that the level 1 and 2 people
can see (although not the same pages) that non logged in people cannot. the
access level cookie is passing fine between the secure pages....did user
access by level:

if(!isset($HTTP_COOKIE_VARS['levelCookie'])){
header("Location: secure.php");
} else {
if($HTTP_COOKIE_VARS['levelCookie'] < 2){
header("Location: secure.php");
}
but when the logged in user travels around the non-secure pages, i loose the
cookie. i do not know how to pass it without using the user access
snippet....

i keep playing with setsession() and $HTTP_COOKIE_VARS, but am not hitting
on the right combo.

also would like to set cookie to 0 on any page, if user is not logged in.
and i cannot figure that out either.

PLEASE PLEASE PLEASE help me!!
 

Archived message: cookie issues (Macromedia Dreamweaver)