Are there any recommended resources or links for learning more about securely handling cookies in PHP?

When handling cookies in PHP, it is important to ensure they are securely managed to prevent security risks such as cross-site scripting attacks. One way to do this is by setting the 'secure' and 'httponly' flags on the cookie to restrict its transmission to secure HTTPS connections and prevent access via JavaScript, respectively.

// Set a secure and httponly cookie
setcookie('cookie_name', 'cookie_value', time() + 3600, '/', 'example.com', true, true);