With the advent of sessionStorage and localStorage, this isn't a very good idea... cookies are sent on every client-server request, and this doesn't seem to be meant for server usage at all. Cookies should be kept to a bare minimum, not sore session state.