The people on this website seem to know everything so I figured I would ask this just in case:
Is there a method/function in prototype that converts a JSON object to
Assuming you're speaking of Prototype JavaScript framework, why not just use JavaScript's own JSON functionality? JSON does after all stand for JavaScript Object Notation.
Sure there is: Prototype JSON
var data = {name: 'Violet', occupation: 'character', age: 25 };
var myString = Object.toJSON(data);
// myString = '{"name": "Violet", "occupation": "character", "age": 25}'
Then shove myString into your cookie