What are the best practices for configuring session extensions in PHP when setting up a Web-FTP access?

When setting up Web-FTP access in PHP, it is important to configure session extensions properly to ensure secure and reliable user sessions. One best practice is to set a specific session cookie name to avoid conflicts with other applications. Additionally, using HTTPS for secure communication and setting session cookie parameters such as secure, HttpOnly, and SameSite attributes can enhance security.

// Configure session settings for Web-FTP access
session_name("webftp_session");
session_set_cookie_params([
    'lifetime' => 0,
    'path' => '/',
    'domain' => 'example.com',
    'secure' => true,
    'httponly' => true,
    'samesite' => 'Strict'
]);
session_start();