Re: Test for Cookies
| From: | Karl J. Stubsjoen | Date: | Wed, 24 Jan 2001 18:41:29 +0000 |
| Subject: | Re: Test for Cookies | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-36448@lists.php.net to get a copy of this message | ||
> Karl J. Stubsjoen [karlflips@kstub.com] wrote:
> > Hi,
> >
> > I need to test for cookies. What is the simplest way to do this?
>
> Be a little more specific - do you want to know if there
> are cookies at all, or if there are specific cookies?
>
> Depends on the settings in the Data Handling section of your
> php.ini. With register_globals = On and track_vars = On, I
> can do this:
both of these are On. Is this a *FOR SURE* way to tell if cookies are
enabled on the
client machine???
>
> if (sizeof($HTTP_COOKIE_VARS) == 0) {
> error_log("no cookies!!!");
> }
>
>
> or
>
>
> if (empty($HTTP_COOKIE_VARS["my_cookie_1"])) {
> error_log("my_cookie_1 doesn't exist!");
> }
>
>
> HTH.
> --
> Hardy Merrill
> Mission Critical Linux, Inc.
> http://www.missioncriticallinux.com
>
> >
> > Thanks - Karl
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
>