"Cpt John W. Holmes" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > From: "Steve Buehler" <[EMAIL PROTECTED]> > > hmmmmm. Looks like on my localhost I can't seta cookie like this: > > setcookie ("coach_access[login_id]", "coach",0,"/","$cookhost"); > > if I change it to just: > > setcookie ("coach_access_login_id", "coach",0,"/","$cookhost"); > > it will work. But then my script won't work without a lot of re-writing > > because it uses $coach_access[login_id] instead. Any help here? Am I > just > > doing something wrong? I can't set it with the following either. > > header('Set-Cookie: coach_access[login_id]=coach'); > > But can as: > > header('Set-Cookie: coach_access_login_id_=coach'); > > but again, I would have to re-write a lot of script. > > You'd be better of if you re-wrote your code to make it correct, but you > could just put: > > $coach_access['login_id'] = $_COOKIE['coach_access[login_id]']; > > Please don't tell us that you're storing login IDs in a cookie and actually > depending upon them for anything??
Um, why not? I do it all the time, and if there is some security issue or other reason to not do it I'd like to know so I can change my style in the future. I generally create a random hex string 40 chars long and store it as a cookie called loginid. -- Rob > > ---John Holmes... > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php