How can PHP session cookies be configured to prevent the browser console warning about cross-site cookies?

When using PHP session cookies, the browser console may show warnings about cross-site cookies if the SameSite attribute is not set. To prevent this warning, you can configure the PHP session cookie to include the SameSite attribute with the value 'Lax' or 'Strict'. This can be done by setting the session.cookie_samesite configuration option in your PHP code.

// Set PHP session cookie to include SameSite attribute
ini_set('session.cookie_samesite', 'Lax');

// Start the session
session_start();