By Manuel Lemos
Newer PHP versions often provide improved security features. That is the case of the SameSite cookie support to help your site to be better protected against Cross-Site Request Forgery (CSRF) attacks.
Read this short article to learn more about CSRF attacks, SameSite cookies, and code examples of how to benefit from improvements done in PHP 7.3 and PHP 8.3 to quickly implement this option to protect better your sites from these attacks.
There are more modern ways to generate random strings. Read another article about the \Random\Randomizer class to learn more about modern ways to generate random values.