You're looping over the recordset returned by the CFX, and each time,
setting the Cookie. Each time through, the cookie gets reset, rather
than appended. Instead, I'd build a string in your loop, and only set
the cookie once, after the loop completes.
<cfset str = "">
<cfloop...>
<cfset str = listAppend(str, group, " ")>
</cfloop>
<cfcookie name="SetGroups" value="#str#" expires="NEVER">
---
Billy Cravens
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On
Behalf Of phumes1
Sent: Thursday, March 28, 2002 1:08 PM
To: [EMAIL PROTECTED]
Subject: Re: <CFCOOKIE
Hi,
I'm using a custom tag the displays the groups assigned to a specific
user
which works fine.
The code below is in my application.cfm file in my wwwroot. I can't seem
to
figure out when I set a cookie it only displays the last group of that
user?
When I run the code for the first time the following groups are
displayed
from the #group#
contract hrls supprt tax Administrators
Groups: Administrators
Why is it only displaying "Administrators" and not the who string?
The idea is to use the cookie.SetGroups to set profiles for each user
based
on the groups assigned to them
via NT.
<cfif IsDefined("Cookie.Groups") is "False">
<cfcookie name="Groups" value="1">
<!--- START LIST VALID GROUPS FOR A SPECIFIC USER --->
<CFX_Users ACTION="GROUPS" SCOPE="Local" USER="test">
<CFIF IsDefined("Users")>
<CFIF IsQuery(Users)>
<CFLOOP QUERY="Users">
<cfoutput>
#Group#
</cfoutput>
<cfcookie name="SetGroups" value="#group#"
expires="NEVER">
</CFLOOP>
</CFIF>
</CFIF>
<!--- END LIST VALID GROUPS FOR A SPECIFIC USER --->
</cfif>
Groups: <cfoutput>#COOKIE.SetGroups#</cfoutput>
+-----------------------------------------------------------------------
------------+
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