In this example, we first start a session and generate a CSRF token if it does not exist. We then set the token as a cookie with a one-hour expiration time. This code example uses PHP's built-in functions to generate a random byte string (random_bytes) that we can use to create a unique token (bin2hex). It is important to note that this code should be used in conjunction with server-side validation to ensure the authenticity of the request. The package library used in this example mainly relies on PHP's built-in functions with session handling and setcookie.