I am creating a PHP login system and I want to know how to best protect the string of user information in my cookie. I thought about encrypting the string with a key somehow? Is this the best way? I am new to this.
Thanks in advance.
Do not store confidential information in cookies. Store the session hash identifier to connect a registered user to your account.
. , , //, . PHP, cookie , . cookie. .
, , - , . , cookie .
, . , (, md5, sha-1 ..), ( , , , - - , ).
cookie. cookie , , :
, , .
cookie , HMAC. hash_hmac PHP.
" ", , , . , cookie . - , , , , cookie , /.
! , PHP/framework-of-your-choice. , UID, . cookie. , manually.
manually
, , , . , . , ID (DB, XML ..).