How do I check the current user session?
You can't really do something like that in Drupal 8.

The short story is that we use Symphony for the Request / Response flow, so actually bootsrapping Drupal is a lot more complex than simply requiring the bootstrap.inc file. If you look at the index.php file, you can see an overview of a request in Drupal 8:

use Drupal\Core\DrupalKernel;
use Symfony\Component\HttpFoundation\Request;

$autoloader = require_once 'autoload.php';

$kernel = new DrupalKernel('prod', $autoloader);

$request = Request::createFromGlobals();
$response = $kernel-&gt;handle($request);
$response-&gt;send();

$kernel-&gt;terminate($request, $response);


Most of this happens in the DrupalKernal::handle call. You could probably make a custom script that hooks into Drupal, but it probably will be a lot easier and more maintable to actually have this code be part of your Drupal installation.