防止多次登录-将当前会话ID与新会话ID进行比较 [英] Preventing Multiple Login- Comparing Current Session ID with new Session ID

查看:83
本文介绍了防止多次登录-将当前会话ID与新会话ID进行比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个登录功能,每个用户都应使用新的会话ID登录,这将阻止其他用户(B),直到当前用户(A)注销才登录.现在我的问题是,是否还有其他用户(B)掌握了当前用户(A)的链接.另一个用户(B)将直接转到当前用户(A)的帐户,而无需进行任何身份验证.而且我认为我有一个解决方案,但是我也缺少语法:$我想要的是将当前用户(A)会话ID存储在数据库中,并且我将在userLogin表中为其创建一个单独的列.如果我仅将当前用户(A)的会话ID存储在该列中,这样即使其他用户(B)掌握了会话ID,也将阻止其他用户(B)不能抓住他的访问权限,那么它将起作用吗?如果是,那么如何? (请键入所有必要的代码),如果否,该怎么办..?

I have created a Login function where every user shall Login with a new Session ID that will prevent other users (B), not to login till the current user (A) logout. Now my problem is that if any other user (B) got his hand on the Link of the of the current user (A). The other user (B) will directly go to the current user (A)''s account without any authentication. And I think I have a solution, yet I lack in syntax as well :$ What I want is to store that current user (A) session ID in the database and I will create a seperate colomn for it in my userLogin table. If I just store the current user (A) Session ID in that colomn where it will prevent the other user (B) not to grab his access even if he got his hands on the Session ID then will it work? if Yes, then How? (Please type all the neccesary Code) and if No, the How can I..?

推荐答案

我要存储的是当前用户(A)会话ID在数据库中,我将在我的userLogin表中为其创建一个单独的列.如果我仅将当前用户(A)的会话ID存储在该列中,这样即使其他用户(B)掌握了会话ID,也将阻止其他用户(B)不能抓住他的访问权限,那么它将起作用吗?如果是,那么如何? (请输入所有必需的代码),如果没有,该怎么办?.
What I want is to store that current user (A) session ID in the database and I will create a seperate colomn for it in my userLogin table. If I just store the current user (A) Session ID in that colomn where it will prevent the other user (B) not to grab his access even if he got his hands on the Session ID then will it work? if Yes, then How? (Please type all the neccesary Code) and if No, the How can I..?


请参阅此 ^ ].


这篇关于防止多次登录-将当前会话ID与新会话ID进行比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆