📄 logoff.aspx
字号:
<%@ Page language="C#"%>
<!--
Copyright 2002-2005 Corey Trager
Distributed under the terms of the GNU General Public License
-->
<!-- #include file = "inc.aspx" -->
<script runat="server">
DbUtil dbutil;
///////////////////////////////////////////////////////////////////////
void Page_Load(Object sender, EventArgs e)
{
Util.do_not_cache(Response);
dbutil = new DbUtil();
dbutil.get_sqlconnection();
// delete the session row
HttpCookie cookie = Request.Cookies["se_id"];
if (cookie != null)
{
// guard against "Sql Injection" exploit
string se_id = cookie.Value.Replace("'", "''");
string sql = @"delete from sessions
where se_id = N'$se'
or datediff(d, se_date, getdate()) > 2";
sql = sql.Replace("$se", se_id);
dbutil.execute_nonquery(sql);
}
Response.Redirect("default.aspx?msg=logged+off");
}
///////////////////////////////////////////////////////////////////////
void Page_Unload(Object sender, EventArgs e)
{
if (dbutil != null) {dbutil.close();}
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -