Home  >  Q&A  >  body text

javascript - How to restrict the same browser from logging in to two accounts

After user A logs in, user B opens another login page. At this time, A will get B's token. The data is messed up (I stored the token in localstorage)! How to deal with it?

伊谢尔伦伊谢尔伦2673 days ago767

reply all(4)I'll reply

  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-27 17:43:53

    Just make a distinction when storing tokens in localstorage

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-27 17:43:53

    登录页, 第一件事情就是*判断是否有token/cookie等*, 
    已经登录(token没过期)的用户, *直接跳转到index页*.
    一个浏览器当前只能登陆一个账号.

    reply
    0
  • 为情所困

    为情所困2017-05-27 17:43:53

    When a logged-in user opens the login page, he should be redirected to the user's personal homepage

    reply
    0
  • PHPz

    PHPz2017-05-27 17:43:53

    Reset storage when logging in

    reply
    0
  • Cancelreply