javascript - How to restrict the same browser from logging in to two accounts
伊谢尔伦
伊谢尔伦 2017-05-27 17:41:53
0
4
786

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?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(4)
曾经蜡笔没有小新

Just make a distinction when storing tokens in localstorage

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

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

PHPzhong

Reset storage when logging in

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!