From 20f7b1c96ed38370ac4a62bc61076b2ddaf3025e Mon Sep 17 00:00:00 2001 From: ja Date: Fri, 15 Oct 2021 17:00:54 +0200 Subject: [PATCH] =?UTF-8?q?Sessionvariablen=20werden=20am=20ende=20jeder?= =?UTF-8?q?=20Sesssion=20sicher=20gel=C3=B6scht.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Global.asax | 9 +++++++-- login/Logout.aspx.vb | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Global.asax b/Global.asax index 24cbca0..4935182 100644 --- a/Global.asax +++ b/Global.asax @@ -20,7 +20,10 @@ void Application_End(object sender, EventArgs e) { // Code, der beim Herunterfahren der Anwendung ausgeführt wird - + Session.Remove("TokenforEmail"); + Session.Remove("SessID"); + Session.Remove("urltochangepw"); + } } void Application_Error(object sender, EventArgs e) @@ -41,7 +44,9 @@ // Hinweis: Das Ereignis "Session_End" wird nur ausgelöst, wenn der Modus "sessionstate" // in der Datei "Web.config" auf "InProc" festgelegt ist. Wenn der Sitzungsmodus auf "StateServer" // oder "SQLServer" festgelegt ist, wird das Ereignis nicht ausgelöst. - Session.Remove("TokenforEmail") + Session.Remove("TokenforEmail"); + Session.Remove("SessID"); + Session.Remove("urltochangepw"); } diff --git a/login/Logout.aspx.vb b/login/Logout.aspx.vb index a6916e8..44ec222 100644 --- a/login/Logout.aspx.vb +++ b/login/Logout.aspx.vb @@ -8,7 +8,7 @@ Partial Class login_Logout Sub Page_Load() Handles Me.Load FormsAuthentication.SignOut() Session.Clear() - + Session.Abandon() 'clear authentication cookie 'Dim cookie1 As HttpCookie = New HttpCookie(FormsAuthentication.FormsCookieName, "") 'cookie1.Expires = DateTime.Now.AddYears(-1) @@ -20,14 +20,14 @@ Partial Class login_Logout 'Dim cookie2 As HttpCookie = New HttpCookie(sessionStateSection.CookieName, "") 'cookie2.Expires = DateTime.Now.AddYears(-1) 'Response.Cookies.Add(cookie2) - Response.Redirect("../newpageJulius_Sidebar.aspx") + Response.Redirect("../login/login_FLEX.aspx") End Sub Protected Sub btn_backtostart_Click(sender As Object, e As EventArgs) - Response.Redirect("../newpageJulius_Sidebar.aspx") + Response.Redirect("../login/login_FLEX.aspx") End Sub End Class