How about...

<cfif listFind(cookie.displayGroups, "Mike")>
  do stuff
</cfif>

There is also listFindNoCase().

If these groups are related to security for your application, I would
suggest storing them elsewhere, or encrypting the text if it MUST be in a
cookie.  Cookies are fairly easy to modify on most browsers and someone
could easily put themselves in the "Administrator" group.

-Justin Scott, Lead Developer
 Sceiron Internet Services, Inc.
 http://www.sceiron.com


----- Original Message -----
From: "phumes1" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, May 02, 2002 7:07 AM
Subject: Re: Check for text within cookie...Help!


> Hi,
>
> I'm setting a cookie that can contain 1-10 different groups. For example:
>
> <cfoutput>
> #COOKIE.DisplayGroups#
> </cfoutput>
>
> Output:
> ----------
>
> Administrator,Users,Power Users,Mike,Paul,Dave,Sarah
>
>
> I would like to check the "COOKIE.DisplayGroups" for one of the above
groups.
>
> If COOKIE.DisplayGroups = Mike
> ---code here ---
> endif
>
> I've tried using <cfif ListLen() but it looks for an EXACT match not just
> only one of the above occurrences.
>
> I have tried numerous syntaxs but just can't get it. I know I'm missing
> something.
>
> Help...
>
>
>
>
>
+---------------------------------------------------------------------------
--------+
>
> Philip Humeniuk
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
+---------------------------------------------------------------------------
---------+
>
>
> 
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to