Encrypt Cookie in browser
I want to encrypt cookie in browser
Please tell me the different ways to do this
Thanks开发者_运维百科
Your question isn't very clear. You should use HTTPS for the connection and set the secure flag to make sure that the cookie is always sent encrypted. I assume that is what you want to do.
If you're thinking about doing your own encryption in JavaScript then don't do it because you won't get the level of neither security nor performance anywhere near that of SSL/TLS that the browser has already built in.
If you're serious about cookies security then I recommend reading the Secure Cookie Protocol paper by Liu, Kovacs, Huang and Gouda (PDF).
You never encrypt cookies. If you have to then your security model is flawed. You should tell more about the problem you are trying to solve for us to help you better.
EDIT: Why the downvote? Explain when you disagree.
精彩评论