What is the best way to protect PHP login cookie data?

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.

+5
source share
5 answers

Do not store confidential information in cookies. Store the session hash identifier to connect a registered user to your account.

+23
source

. , , //, . PHP, cookie , . cookie. .

, , - , . , cookie .

, . , (, md5, sha-1 ..), ( , , , - - , ).

+4

cookie. cookie , , :

  • cookie - , , .
  • cookie , , , , , , , , ip /...

, , .

+2

cookie , HMAC. hash_hmac PHP.

" ", , , . , cookie . - , , , , cookie , /.

0

! , PHP/framework-of-your-choice. , UID, . cookie. , manually.

, , , . , . , ID (DB, XML ..).

0

All Articles