Cookie storage WDDX compat not quite right.

Luis, some time ago I pointed out that the cookie storage’s change from WDDX/simple values to JSON would error when someone updated their version of ColdBox and a user with existing cookies hit the site. Those cookies would have been created by a previous version of the cookie storage plugin and would error when it tried to JSON decode them.
http://groups.google.com/group/coldbox/browse_thread/thread/aea6a01189c6fc3a/fea17732b4aaf2a7?lnk=gst&q=cookiestorage+json#fea17732b4aaf2a7

So long story short, I happened across the code in the cookie storage plugin and noticed it still isn’t quite backwards compatible. Your update checks to see if the stored value is WDDX and if it is, unserializes the WDDX and re-serializes as JSON. However, the case you didn’t account for is when the previous version of the cookieStorage plugin saved simple values which employed no encoding at all.

Ideally I would just add an additional isJSON check, but I know we have to still support CF7 and the JSON plugin in ColdBox appears to not implement an isJSON method.
I changed the following line of cookieStorage.getVar():

](http://instance.json.decode(rtnVar)>);

to this:

](http://instance.json.decode(rtnVar)>);

I have committed this change to my local clone of my Github ColdBox fork, but unfortunately I also have other commits in that my master branch for my previous pull requests that will be included (even though I don’t want them) if I try to do a new pull request. I am waiting on your reply to my comment on my previous pull request before I reset my master branch and re-branch for my pull requests since I don’t want to yank any code if you are still looking at it for my previous pull.

Alternatively (since these pull requests are becoming a bit of a pain for very simply fixes) I can try to just send you a patch instead of creating a pull request for this.

Thanks!

~Brad

np, added and fixe.d

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com