This topic has not yet been rated - Rate this topic

WebSecurity.Logout Method

Logs the user out.

Namespace:  WebMatrix.WebData
Assembly:  WebMatrix.WebData (in WebMatrix.WebData.dll)
public static void Logout()
ExceptionCondition
InvalidOperationException

The SimpleMembershipProvider.Initialize(String, NameValueCollection) method was not called.

-or-

The InitializeDatabaseConnection() method was not called.

-or-

The SimpleMembershipProvider membership provider is not registered in the configuration of your site. For more information, contact your site's system administrator.

This method removes the authentication token, which has the effect of logging the user out.

For an example of how to use of the Logout() method, see the Logout.cshtml file in the Starter Site template.

  • Medium trust for the immediate caller. This member can be used by partially trusted code.
Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.