Best practices for Clearing data in services on logout in AngularJs

后端 未结 2 1254
时光取名叫无心
时光取名叫无心 2020-12-31 06:21

I have several services which uses a webservice and caches a lot of the results.By caching i mean storing in a variable on the service. When a user logs out the data should

2条回答
  •  囚心锁ツ
    2020-12-31 06:54

    you can use a full page refresh:

    $window.location.reload();
    

    this will restart the whole state of your application

    another solution could be to store everything in session storage and then clear it on log out:

    sessionStorage.clear();
    

提交回复
热议问题