[PHP 7.1] How to fix the «Cannot use a scalar value as an array in Magento/Framework/Session/SessionManager.php on line 437» bug?

Locate the line:

Replace it with the following one:

return isset($_SESSION[self::HOST_KEY]) && $_SESSION[self::HOST_KEY] ? $_SESSION[self::HOST_KEY] : [];

See also:

The current Magento 2.2 development branch becomes to support PHP 7.1.