?
Dieses Dokument verwendet PHP-Handbuch für chinesische Websites Freigeben
Logout() 方法注銷當(dāng)前用戶。
Logout()
// 退出登錄
WebSecurity.Logout();
// 跳轉(zhuǎn)回主頁
Response.Redirect("~/");
' 退出登錄
WebSecurity.Logout()
' 跳轉(zhuǎn)回主頁
Response.Redirect("~/")
無。
無。
在下面的情況下,任何對 WebSecurity 對象的訪問將拋出一個(gè) InvalidOperationException:
當(dāng)用戶已登錄,ASP.NET 在 cookie 中設(shè)置一個(gè)身份驗(yàn)證令牌,讓 ASP.NET 知道用戶已登錄的后續(xù)請求。
Logout() 方法移除身份驗(yàn)證令牌,注銷用戶。
名稱 | 值 |
---|---|
Namespace | WebMatrix.WebData |
Assembly | WebMatrix.WebData.dll |