I'm trying to start a session for anonymous users (using Drupal 8.2.2), so I can use the private temp store, but the session does not persist. This is what happens with anon users:
// $session is the Drupal `session` service (Symfony Session component) $session->start(); var_dump($session->isStarted()); // always FALSE var_dump($session->getId()); // changes from request to request
With an authenticated user,
isStarted() returns TRUE, and the session ID remains the same.
How can I start a session for anonymous users that will enable private temp store?