This is probably not the way to do this (I'm not immersed in your code), but
a way that will accomplish what you are doing is:

<cfif IsDefined("COOKIE.DisplayGroups") AND ListLen(COOKIE.DisplayGroups)>

<cfswitch expression="#COOKIE.DisplayGroups#">

<cfcase value="Admin">
        Do something
</cfcase>

<cfcase value="Work">
        Do something
</cfcase>
        
</cfswitch>

</cfif>

Best of luck
J



-----Original Message-----
From: phumes1 [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002 1:39 PM
To: [EMAIL PROTECTED]
Subject: RE: Checking contents of cookie



Maybe I'm not explaining my problem clearly.

Let say for example I have the following cookie text which may be different 
based on every user.

<cfoutput>
#COOKIE.DisplayGroups#
</cfoutput>

Administrators,Users,Work,Dave,Paul,Jimmy,Sarah


How can I check the above cookie string to see if "Dave" exists. If so, run 
some code.




At 12:11 PM 5/1/2002 -0500, you wrote:
>Do you mean you want to perform an action if the cookie contains any of
>those 3? If so, a simple change should do it:
>
>
><cfif ListFindNoCase(COOKIE.DisplayGroups,"Administrators") OR
>ListFindNoCase(COOKIE.DisplayGroups,"Users") OR
>ListFindNoCase(COOKIE.DisplayGroups,"Work")>
>          CODE HERE...
></cfif>
>
>-----Original Message-----
>From: phumes1 [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, May 01, 2002 12:07 PM
>To: [EMAIL PROTECTED]
>Subject: RE: Checking contents of cookie
>
>
>
>I have a cookie that returns the following
>
><cfoutput>
>#COOKIE.DisplayGroup#
></cfoutput>
>
>Administrators,Users,Work
>
>The code below looks for an EXACT match of the above cookie. How can I
>just
>search/find either
>Administrators or Users or WORK within the cookie?
>
><cfif ListFindNoCase(COOKIE.DisplayGroups,"Administrators")>
>          CODE HERE...
></cfif>
>
>
>
>+-----------------------------------------------------------------------
>------------+
>
>Philip Humeniuk
>[EMAIL PROTECTED]
>[EMAIL PROTECTED]
>+-----------------------------------------------------------------------
>-------------+
>
>
>
>------------------------------------------------------------------------
>-
>This email server is running an evaluation copy of the MailShield anti-
>spam software. Please contact your email administrator if you have any
>questions about this message. MailShield product info:
>www.mailshield.com
>
>-----------------------------------------------
>To post, send email to [EMAIL PROTECTED]
>To subscribe / unsubscribe: http://www.dfwcfug.org
>
>-------------------------------------------------------------------------
>This email server is running an evaluation copy of the MailShield anti-
>spam software. Please contact your email administrator if you have any
>questions about this message. MailShield product info: www.mailshield.com
>
>-----------------------------------------------
>To post, send email to [EMAIL PROTECTED]
>To subscribe / unsubscribe: http://www.dfwcfug.org


+---------------------------------------------------------------------------
--------+ 

Philip Humeniuk
[EMAIL PROTECTED]
[EMAIL PROTECTED]
+---------------------------------------------------------------------------
---------+



-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to