Click here to Skip to main content
15,867,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I am using Membership Providers to control user access

I get how the timeout works. That's already in place.

We have a suite of software, some web based (aspx) and 1 windows, but that's my colleagues problem ^_^

When a user is added to the system, we create an account in 4 different systems with IsActive set to false. When they are granted access to an account, we set IsActive to true.
Edit: When a users access is revoked we set IsActive back to false.
This works fine for preventing someone from logging in, but I would also like to "kick out" any user already logged into the system.

Currently it looks as though once a user has logged on, they will stay logged in until they log out or the timeout expires.

Google searching for this hasn't helped :S

Any advice is welcome.

Thanks
Andy

What I have tried:

Much of the data comes from SignalR. I can check the users status at that stage, but my colleagues web based app doesn't use SignalR. I am looking for a more typical solution
Posted
Updated 8-Sep-16 22:35pm
v2

1 solution

So every time a user is created you want to log everyone out? Doesn't make sense to me. Also why do you want to log people out? What is the advantage of that?

Regardless, if you are logged in is dictated by cookies and you can't update the cookies on people's machines unless they are making a request to your site. So basically you can't log people off. You'll need to come up with some mechanism that defines whose authentication should not be persisted, and on every request to the site check if the user is on that list and if so log them off at that point.
 
Share this answer
 
Comments
Andy Lanng 9-Sep-16 4:34am    
Sorry - forgot to mention:
When a users access is revoked, we want to log that user off (i'll update the question).

How do I log someone off when they make a request to the site?
F-ES Sitecore 9-Sep-16 4:50am    
When a user's access is revoked their next request to the site will fail, so you shouldn't have to do anything.
Andy Lanng 9-Sep-16 4:52am    
Ah thanks. I musta been mistaken

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900