Allow only one concurrent login per user in ASP.NET

后端 未结 6 1192
渐次进展
渐次进展 2020-12-15 08:39

Is it possible to allow only one concurrent login per user in ASP.NET web application?

I am working on a web application in which I want to make sure that the websi

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-15 09:09

    Solution can be this way:

    Add new column in your login table GuidCode.
    Step 1 : When logging in check if the GuidCode in database is null.
    Step 2 : Update GuidCode by new guid and also store it in the session.
    Step 3 : If it is not null then take guid from the session and compare with database GuidCode value.
    Step 4 : If it is same then allow login:

提交回复
热议问题