How to save encrypted data in cookie (using php)?

前端 未结 5 856
耶瑟儿~
耶瑟儿~ 2020-12-15 14:49

I would like to save data in cookies (user name, email address, etc...) but I don\'t the user to easily read it or modify it. I need to be able able to read the data back. H

5条回答
  •  我在风中等你
    2020-12-15 15:21

    I suggest you not only encrypt but also sign the data. If you don't sign the data, you won't be able to tell reliably whether the user modified the data. Also, to avoid replay you may want to add some timestamp/validity period information into the data.

提交回复
热议问题