I've read about the
\Drupal::service('user.private_tempstore')->get('mymodule_name');
and found similar to storing data in $_SESSION.
I am using user.private_tempstore in my module to store some data related to the user for a current session but when I logout and login again to the system found the value still persist in that variable. It is supposed to delete on logout.
To store data
$userSession = \Drupal::service('user.private_tempstore')->get('user_profile');
$userSession->set('user_profile', TRUE);
To get data
$userSession = \Drupal::service('user.private_tempstore')->get('user_profile');
$user_profile = $userSession->get('user_profile');
Is my understanding wrong?