Retain data on page reload in Angular 2

a 夏天 提交于 2019-12-06 03:08:16
Smit

Nope, There isn't a other way in this context. Once you refresh all the temporary memory is gone. As you said you are performing session-storage. You may continue with that. You may choose the below.

  1. LocalStorage
  2. Cookie
  3. Session

Difference and importance: How to store token in Local or Session Storage in Angular 2?

I would strongly advise you implement some server side framework and implement a database and store and retrieve data that way, it's a lot cleaner and much more reliable, session is a very dated way of doing things, at minimum I would use cookies so they at least persist a little more reliably.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!