Fixed an issue with cookie based storage where values were not being parsed as objects.

I've added a try/catch statement where the value stored in the cookie is tested in order to see if it can be serialized as an object.