I have
done this before with persisting shopping carts.
If
your on CF5, you can CFWFDDX the session structure and store in the database
based on the cookie.
If
your on CFMX, you can also convert to an XML packet and store
that.
Or use
client variables, which you should be storing in the database anyway. Client
vars cannot contain complex vars, like structures, so you just CFWDDX the data
in and out of the client variable.
You
can of course also encrypt the deserialized data for extra security as
well.
Russ
Michaels
Macromedia/Allaire Certified
ColdFusion Developer
CFDeveloper
The free resource and community for
ColdFusion developer.
Join the CFDeveloper discussion lists.
To subscribe send an e-mail to [EMAIL PROTECTED]
-----Original Message-----
From: Sam Westlake [mailto:[EMAIL PROTECTED]
Sent: 09 April 2004 11:20
To: [EMAIL PROTECTED]
Subject: [ cf-dev ] Serialise a Structure?Hi All,Not sure if anyone will be around today as it is a bank holidday, but here goes.I am persisting a Struct() as a session variable - at the end of the session I want to be able to serialise the structure and store it as a string in a database. Then deserialise it when ever I want to.Can I do this in CF or do I need to drill down to J2EE? Say it isn't so! Maybe CFC's?Sam Westlake
