Can I force a log out through SQL for asp.net membership account?
            Asked
            
        
        
            Active
            
        
            Viewed 490 times
        
    0
            
            
        - 
                    I added 'forms-authentication' tag since it was stated that was the auth mode in a comment below. – ddc0660 Dec 16 '09 at 16:08
2 Answers
1
            
            
        For forms authentication you can use:
FormsAuthentication.SignOut();
FormsAuthentication.RedirectToLoginPage();
If you are trying to do this through Windows authentication see this.
 
    
    
        Community
        
- 1
- 1
 
    
    
        David Glass
        
- 2,334
- 1
- 25
- 35
- 
                    
- 
                    1Not sure I understand than, what do you mean through SQL. What Authentication are you using? Forms, Windows, or Passport? – David Glass Dec 15 '09 at 20:42
- 
                    I am using Forms Authentication. But I am trying to log someone out inside of my SQL code, but that seems impossible. – TPR Dec 15 '09 at 22:03
1
            No record of currently logged in users are stored in Forms Authentication mode so it would be impossible to log out a user by some SQL execution alone.
Note that a data store like SQL is only used during the actual credential authentication step of the Forms Authentication lifetime:
Forms authentication control flow http://i.msdn.microsoft.com/Aa480476.formsauth(en-us,MSDN.10).gif
Forms Authentication generally utilizes client-side cookies to handle currently logged in users.
 
    
    
        ddc0660
        
- 4,022
- 2
- 21
- 30
