本文整理汇总了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();
}