What best practices should PHP developers follow when setting up session cookie handling in a localhost environment using XAMPP?

When setting up session cookie handling in a localhost environment using XAMPP, PHP developers should ensure that the session cookie is secure by setting the 'secure' flag to false, as localhost is not considered a secure environment. Additionally, developers should set the 'httponly' flag to true to prevent client-side scripts from accessing the cookie. Finally, developers should set the 'sameSite' attribute to 'None' to allow cross-site requests.

// Set session cookie parameters
session_set_cookie_params([
    'lifetime' => 0,
    'path' => '/',
    'domain' => 'localhost',
    'secure' => false,
    'httponly' => true,
    'samesite' => 'None'
]);