I've simple SPA and I make log out on reloading. As I understand the disadvantage of NOT logging out on reloading is to reinitialization of the whole application.

Questions:

  1. What are the disadvantages of NOT logging off at Single Page Application?
  2. What is the best way to achive NOT loging of on reloading (F5)?
有帮助吗?

解决方案

  1. The advantage is that not logging off will avoid pissing off your users so much that they'll want to kill you :-). Seriously, if an application logged me off every time I refresh a page (or open a link in a new tab), I would never use that application again.

  2. Well, don't do it. Make sure the authentication token is stored in a place surviving a refresh, i.e. not in some JS variable, but in a cookie or local storage, for example.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top