Symfony 4 session expire too soon
Problem solved.
The problem was save_path. Just use the parameters suggested in the official Symfony Documentation. In this way your cookies will be correctly stored.
session: handler_id: session.handler.native_file save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%' cookie_lifetime: 604800