Use list functions. You can specify any delimiter you want, not just
','. So think of this as a double-level list, with the top level using
'&' as a delimiter and the lower level using '=' as a delimiter.

<cfset result = StructNew()>
<cfloop list="cookie-var" index="i" delimiters="&">
        <cfset result[ListFirst( i, '=' )] = ListLast( i, '=' )>
</cfloop> 

Thus you'd end up with a key-value struct. There might be a cleaner way
of doing this, that's just off the top of my head.

Kam

-----Original Message-----
From: Bailey, Neal [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 12, 2004 8:51 AM
To: CF-Talk
Subject: cookie issues... 

Hey guys... 
 
I am having Cookie issues... I have a cookie that's written using ASP to
store some info in kind of an array. I am trying to read that same
cookie using Coldfusion but I can't seem to get it to output the way I
need it. I can read the cookie but it's all strung together with "=" and
"&"s. I need a way to parse the cookie and save it as a session
variable.  
 
When I do a regular cookie request my string looks like this:
"NeedUpdate=0&Recognition=Support&EntityID=0000000001&AgentName=Neal
Bailey&Rank=100&AgentNumber=5555"
 
Any suggestions how I can read the cookie and restructure it in a way
that I can use? Thanks. 
 
 
Here is the code that makes the cookie in ASP. 
 
' Response.Clear
      agUser = RSAgent("AgentNumber")
      Response.Cookies("RSAgent")("AgentNumber") =
RSAgent("AgentNumber")
      Response.Cookies("RSAgent")("AgentName") =
RTrim(RSAgent("AgentFirst"))+
       " " +    RTrim(RSAgent("AgentLast"))
      Response.Cookies("RSAgent")("Rank") = RSAgent("CurrentRank")
      Response.Cookies("RSAgent")("Recognition") =
RTrim(RSAgent("Recognition"))
      Response.Cookies("RSAgent")("EntityID") = RSAgent("EntityID")
      Response.Cookies("RSAgent")("NeedUpdate") = RSAgent("NeedUpdate")
      Response.Cookies("RSAgent").Path="/"
 
 
 
Thanks... 
Neal Bailey
 




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:184172
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to