Implemented serializer for cookies