how can I set a session variable in Drupal 8 and get it in a php script?
PHP Snippet 1:
$tempstore = \Drupal::service('tempstore.private')->get('your_module_name');
$tempstore->set('value', 'hi');
PHP Snippet 2:
$tempstore = \Drupal::service('tempstore.private')->get('your_module_name');
$some_data = $tempstore->get('value');