本文整理汇总了C#中System.Web.HttpSessionStateBase.Abandon方法的典型用法代码示例。如果您正苦于以下问题:C# HttpSessionStateBase.Abandon方法的具体用法?C# HttpSessionStateBase.Abandon怎么用?C# HttpSessionStateBase.Abandon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.HttpSessionStateBase
的用法示例。
在下文中一共展示了HttpSessionStateBase.Abandon方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Logout
public static void Logout(HttpSessionStateBase session, HttpResponseBase response)
{
var module = FederatedAuthentication.SessionAuthenticationModule;
module.DeleteSessionTokenCookie();
module.SignOut();
session.Abandon();
}
示例2: Logoff
/// <summary>
/// Clears the user session, clears the forms auth ticket, expires the forms auth cookie.
/// </summary>
/// <param name="session">HttpSessionStateBase</param>
/// <param name="response">HttpResponseBase</param>
public static void Logoff(HttpSessionStateBase session, HttpResponseBase response)
{
// Delete the user details from cache.
session.Abandon();
// Delete the authentication ticket and sign out.
FormsAuthentication.SignOut();
// Clear authentication cookie.
HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, "");
cookie.Expires = DateTime.Now.AddYears(-1);
response.Cookies.Add(cookie);
}
示例3: Destroy
/// <summary>
/// Destroys the specified session.
/// </summary>
/// <param name="session">The session.</param>
public static void Destroy(HttpSessionStateBase session)
{
if (session == null)
{
return;
}
session[SessionKey] = null;
session.Abandon();
}
示例4: ClearSession
/// <summary>
/// Clears the session of all indexes & variables
/// </summary>
/// <param name="session"></param>
public static void ClearSession(HttpSessionStateBase session)
{
session.Clear();
session.Abandon();
}
示例5: destroy
internal static void destroy(HttpSessionStateBase session, HttpResponseBase response)
{
session.Clear();
session.Abandon();
response.Cookies.Remove("PaydromeUserLogin");
}
示例6: SignOut
public void SignOut(HttpSessionStateBase session)
{
formsAuthentication.SignOut();
session.Abandon();
}
示例7: Destroy
/// <summary>
/// Destroy
/// </summary>
/// <param name="sessionState"></param>
public static void Destroy(HttpSessionStateBase sessionState)
{
sessionState.Abandon();
}