>>3 The cookie itself is not the problem, the session data on the server is. Logout should destroy it:
<?php
// before session_start(), e.g. in a bootstrap file
ini_set('session.use_strict_mode', '1');
session_set_cookie_params([
'lifetime' => 0,
'path' => '/',
'secure' => true, // https only
'httponly' => true, // not readable from JavaScript
'samesite' => 'Lax',
]);
session_start();
// after a successful password_verify()
session_regenerate_id(true); // new id, protects against session fixation
$_SESSION['user_id'] = $row['id'];
// logout
$_SESSION = [];
session_destroy();
setcookie(session_name(), '', ['expires' => 1, 'path' => '/', 'secure' => true, 'httponly' => true, 'samesite' => 'Lax']);
>>4 Do not just make the session live for months. The usual way is a separate random token (bin2hex(random_bytes(32))) in its own cookie, with only its hash stored in the database, an expiry date, and a new token every time it is used. On password change, delete all such tokens of that user.