When user.private_tempstore gets deleted 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')-&gt;get('user_profile');
  $userSession-&gt;set('user_profile', TRUE);


To get data

  $userSession = \Drupal::service('user.private_tempstore')-&gt;get('user_profile');
  $user_profile = $userSession-&gt;get('user_profile');


Is my understanding wrong?
Private tempstore data isn't deleted when you log out, it is usually deleted after a predefined, fixed amount of time.

If you want data that is deleted on logout, then either store in the session or store it somewhere with a random key that you put into a session (Useful when it is data that is no commonly needed on every request and/or larger than just a simple scalar value)