Are Cookies a Security Risk?
Assume we have a website that asks the user for his name. The website then stores this value in a cookie, and on the next page, retrieves it via PHP and uses it somehow (perhaps the page displays the name as text). Could a user modify the cookie data to inject malicious code? Should cookie data be sanitized as it's retrieved by the script? (This is a hypothetical scenario. Obviously a cookie wouldn't be necessary here.) Could a user modify the cookie data to inject malicious code? Should cookies be sanitized as they're retrieved by the script? Inject malicious code? Not PHP code, but you are