Logout ist nun von überall ohne Session Cookies möglich

This commit is contained in:
ja
2021-09-16 16:17:08 +02:00
parent 1deb7365f5
commit 506ed3197e
6 changed files with 30 additions and 31 deletions

View File

@@ -2,7 +2,7 @@
Partial Class Customers_Customers
Inherits System.Web.UI.MasterPage
Protected Sub LogoutButton1_Click(sender As Object, e As EventArgs)
MsgBox("Logged out!")
Response.Redirect("../login/Logout.aspx")
End Sub
End Class

View File

@@ -5,7 +5,7 @@
<html lang="en"></html>
<!-- Required meta tags -->
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" title="Verag Spedition AG AvisoTV Flex"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="shortcut icon" href="../images/Icons/favicon/favicon.ico" />
<style>
.nav-item dropdown::marker {

View File

@@ -20,12 +20,8 @@
<body>
<form id="form1" runat="server">
<div>
<%If Me.Page.User.Identity.IsAuthenticated = False Then %>
<h1>Du wurdest erfolgreich ausgeloggt.</h1>
<button type="button" id="btn_backtostart" class="btn btn-primary">Zurück zur Startseite!</button>
<%Else %>
<h1>Du bist noch eingeloggt <%=Me.User.Identity.Name %>.</h1>
<%End If %>
</div>
</form>

View File

@@ -6,23 +6,23 @@ Partial Class login_Logout
Dim sessionname
Sub Page_Load() Handles Me.Load
FormsAuthentication.SignOut()
Session.Abandon()
Session.Clear()
'clear authentication cookie
Dim cookie1 As HttpCookie = New HttpCookie(FormsAuthentication.FormsCookieName, "")
cookie1.Expires = DateTime.Now.AddYears(-1)
Response.Cookies.Add(cookie1)
'Dim cookie1 As HttpCookie = New HttpCookie(FormsAuthentication.FormsCookieName, "")
'cookie1.Expires = DateTime.Now.AddYears(-1)
'Response.Cookies.Add(cookie1)
'clear session cookie
Dim sessionStateSection As New SessionStateSection
sessionStateSection = WebConfigurationManager.GetSection("system.web/sessionState")
Dim cookie2 As HttpCookie = New HttpCookie(sessionStateSection.CookieName, "")
cookie2.Expires = DateTime.Now.AddYears(-1)
Response.Cookies.Add(cookie2)
'Dim sessionStateSection As New SessionStateSection
'SessionStateSection = WebConfigurationManager.GetSection("system.web/sessionState")
'Dim cookie2 As HttpCookie = New HttpCookie(sessionStateSection.CookieName, "")
'cookie2.Expires = DateTime.Now.AddYears(-1)
'Response.Cookies.Add(cookie2)
Response.Redirect("../newpageJulius_Sidebar.aspx")
End Sub

View File

@@ -310,6 +310,9 @@
<li>
<a href="status_Julius.aspx?&lan=<%=laenderkuerzel %>" data-toggle="tooltip" data-placement="right" rel="nofollow" target="_blank" title="Nur durch erfolgreichen Login erreichbar.">Status</a>
</li>
<li>
<a href="../login/Logout.aspx" data-toggle="tooltip" data-placement="right" rel="nofollow" title="Ausloggen.">Logout</a>
</li>
</ul>
</li>
@@ -547,10 +550,10 @@
</a> -->
<asp:LoginView ID="LoginView1" runat="server">
<AnonymousTemplate>
<iframe id="frame1" src="login/login_FLEX.aspx" runat="server" seamless="seamless" style="width:300px;height:300px;overflow:no-content;background-image:none;" scrolling="no" />
<iframe id="frame1" src="/login/login_FLEX.aspx" runat="server" seamless="seamless" style="width:300px;height:300px;overflow:no-content;background-image:none;" scrolling="no" />
</AnonymousTemplate>
<LoggedInTemplate>
<iframe id="frame2" src="login/Loggedin.aspx" runat="server" seamless="seamless" style="width:300px;height:300px;overflow:no-content;background-image:none;" scrolling="no" />
<iframe id="frame2" src="/login/Loggedin.aspx" runat="server" seamless="seamless" style="width:300px;height:300px;overflow:no-content;background-image:none;" scrolling="no" />
</LoggedInTemplate>
</asp:LoginView>
<div style="height:10px"></div>

View File

@@ -5,19 +5,19 @@ Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub LogoutButton_Click(sender As Object, e As EventArgs)
FormsAuthentication.SignOut()
Session.Abandon()
Session.Clear()
'clear authentication cookie
Dim cookie1 As HttpCookie = New HttpCookie(FormsAuthentication.FormsCookieName, "")
cookie1.Expires = DateTime.Now.AddYears(-1)
Response.Cookies.Add(cookie1)
'Dim cookie1 As HttpCookie = New HttpCookie(FormsAuthentication.FormsCookieName, "")
'cookie1.Expires = DateTime.Now.AddYears(-1)
'Response.Cookies.Add(cookie1)
'clear session cookie
Dim sessionStateSection As New SessionStateSection
sessionStateSection = WebConfigurationManager.GetSection("system.web/sessionState")
Dim cookie2 As HttpCookie = New HttpCookie(sessionStateSection.CookieName, "")
cookie2.Expires = DateTime.Now.AddYears(-1)
Response.Cookies.Add(cookie2)
'Dim sessionStateSection As New SessionStateSection
'SessionStateSection = WebConfigurationManager.GetSection("system.web/sessionState")
'Dim cookie2 As HttpCookie = New HttpCookie(sessionStateSection.CookieName, "")
'cookie2.Expires = DateTime.Now.AddYears(-1)
'Response.Cookies.Add(cookie2)
Response.Redirect("login/Logout.aspx")
End Sub