I have a simple asp.net core application I am using cookies as authentication scheme Now I wanted to logout existing logged in users when someone elese from antoher device tried to login I want to logout the previous user I am not using identity , but I am using authentication scheme as cookies , I have table in which i log (userid,ipaddress,time)
I am using builder.Services.ConfigureApplicationCookie and setting cookie name with options,and I have added AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
I am recording every userid in table when he login with (userid,time) How to logout existing user when someone else logged in with same user .
when I login from another browser and and check httpcontext.request.cookies there are three cookies available two for aspnetcore.antiforgery and one for aspnetcore.mvc.cookie tempdataprovider
What I have tried:
I have tried everything comes from internet but it did not work I am not able to identify the existing Logged In user so that I should log it out.