Your question is not very clear. You must use HTTPS to connect and set a secure flag to ensure that cookies are always sent encrypted. I guess this is what you want to do.
If you are thinking of doing your own encryption in JavaScript, do not do this because you will not get a level of security or performance anywhere close to SSL / TLS that is already built into the browser.
If you are serious about cookie security, I recommend reading the protocol for the secure cookie protocol of Liu, Kovacs, Juan and Guda ( PDF ).
source share