php - Prevent Cookies from being edited -



php - Prevent Cookies from being edited -

there many ways users can edit content of cookies. on website, have cookie called "user" stores username user logged in with. however, noticed cookie can edited log in account. there code or parameter can add together setcookie() function, blocks users doing editing cookie?

no, cookie stored on client's machine , client has access it. suggest storing hash instead of user's business relationship name. take hash cookie , retrieve username info storage, if hash has been manipulated won't proper username , know need them log in 1 time again , create valid hash in cookie.

php cookies

Comments

Popular posts from this blog

delphi - blogger via idHTTP : error 400 bad request -

c++ - compiler errors when initializing EXPECT_CALL with function which has program_options::variables_map as parameter -

How do I check if an insert was successful with MySQLdb in Python? -