Title: Message
Hey Neal,
 
Shove the cookie value into an array and then parse the array into a CF structure:
 
<!--- assumes the name of your cfcookie variable is 'cookiecontent'. --->
<!--- Build an array from the whole list, specify '&' as the list delimiter. --->
<cfset cookieArray=getCookielisttoarray(cookiecontent, "&")>
<!--- Loop through the array items.  Treat each array item is itself as a list with '=' as the delimiter. --->
<cfloop from="1" to="#arraylen(cookieArray)#" index="i">

 <cfset "aspcookie.#listfirst(cookieArray[i], "=")#" = listlast(cookieArray[i], "=")>
</cfloop>

<cfdump var="#aspcookie#">
 
Voila!  Now your stuff's in a CF structure called 'aspcookie'.
 
Seth
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bailey, Neal
Sent: Friday, November 12, 2004 10:50 AM
To: [EMAIL PROTECTED]
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

 

Reply via email to