external scripts – How do I log in a user?

I want to log in Drupal 8 users from an external PHP file. I am trying the following code. use DrupalCoreDrupalKernel; use SymfonyComponentHttpFoundationRequest; use DrupaluserUserInterface; //$autoloader = include(‘/vendor/autoload.php’); $autoloader =…