👁 The Problem —

There will be times when multiple users will use your application on the same machine.

Imagine that user A logs into your system and receives the data that is only related to him and then logs out.

After 5 minutes user B logs in and 💣! He still receives the same data as user A.

The situation described above can highly affect your application security especially when you have a caching mechanism to avoid HTTP calls.

This situation usually will happen in one of the following scenarios:

Both of them use the same browser tab, and they didn’t refresh it between the logins. They use the same browser, and their data was cached in the local storage.

🤔 The Reason—

You didn’t clean your store after the LOG_OUT action.

🤓 The Solution —