The simply answer is that you can't, Cookies are meant to store references to your session on the server, you can store as much as you want on the client but you have to be aware that it will be apt to be edited, another alternative is to store encrypted values and translate them with an algorithm, that way if the user modifies the value, then it probably won't make sense as the value will be wrong. What you would probably want is to build a JS model that can sync with a server and add some back end logic to validate, you can check out backbone.js
Remember, cookies are stored on the users's computer hence they can do whatever they want with them