本文整理匯總了C#中System.Web.SessionState.HttpSessionState.Abandon方法的典型用法代碼示例。如果您正苦於以下問題:C# HttpSessionState.Abandon方法的具體用法?C# HttpSessionState.Abandon怎麽用?C# HttpSessionState.Abandon使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Web.SessionState.HttpSessionState
的用法示例。
在下文中一共展示了HttpSessionState.Abandon方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SignOut
public void SignOut(HttpResponse response, HttpSessionState sessionState)
{
var user = GetUser(false);
Logger.Log.Error(string.Format("User {0} sing out.", user.UserName));
response.Cache.SetCacheability(HttpCacheability.NoCache);
response.Cache.SetExpires(DateTime.Now);
FormsAuthentication.SignOut();
sessionState.Abandon();
response.Redirect(@"~/Index.aspx");
response.End();
}
示例2: checkSysConfirm
public static bool checkSysConfirm(HttpSessionState session, HttpResponse response)
{
if (session["sysConfirm"] == null || !((bool)session["sysConfirm"]))
{
session.Abandon();
StringBuilder sbScriptStr = new StringBuilder();
sbScriptStr.Append("<script language=\"javascript\">\n");
sbScriptStr.Append("alert(\"登錄信息丟失,請重新登錄\");\n");
sbScriptStr.Append("if(typeof(window.top.dialogArguments) != \"undefined\"){\n");
sbScriptStr.Append("window.top.dialogArguments.top.location.href=\"../ReLoad.aspx\";\n");
sbScriptStr.Append("window.top.close();\n");
sbScriptStr.Append("}else if(window.top.opener != \"undefined\" && window.top.opener.closed==false){\n");
sbScriptStr.Append("window.top.opener.top.location.href=\"../ReLoad.aspx\";\n");
sbScriptStr.Append("window.top.close();\n");
sbScriptStr.Append("}else{\n");
sbScriptStr.Append("window.top.location.href=\"../ReLoad.aspx\";\n");
sbScriptStr.Append("}\n");
sbScriptStr.Append("</script>\n");
response.Write(sbScriptStr.ToString());
response.End();
return false;
}
return true;
}
示例3: clearSession
private void clearSession(HttpSessionState userSession)
{
string userName = (string)userSession[DatabaseUserSecurityAuthority.IGMADAM_USERNAME];
userSession.Abandon();
userSession.Clear();
userSession[SESSIONMEMBER_DISCONNECTED] = true;
userSession[SESSIONMEMBER_RELOADPAGE] = true;
if (userName != null)
AppendInfo("User " + userName + " has been disconnected");
FormsAuthentication.SignOut();
}
示例4: Borrar
/// <summary>
/// Elimina la sesión de usuario
/// </summary>
/// <param name="sesion"></param>
public static void Borrar(HttpSessionState sesion)
{
sesion.Abandon();
}