You are here: Re: [PHP] number of cookies and if there are any cookies set? « PHP « IT news, forums, messages
Re: [PHP] number of cookies and if there are any cookies set?

Posted by Ken on 10/12/04 11:14

On 4/26/05, AndreaD <andrea.davidson@silene.co.uk> wrote:
> I need two bits of info...
>
> (i) Are there ANY cookies set?
>
> (ii) How many cookies are set?
>
> how do I find this information out?
>
> AD
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

you can access cookies by using the superglobal variable (as an array) $_COOKIE.

if ( isset($_COOKIE['cookiename']) )
{
// do some stuff. cookie with cookiename is set.
}

i don't know the best method to check how many cookies are set but i
guess you count the array $_COOKIE.

$number = count($_COOKIE)

hope this helps.

Ken

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация