T
Tomk
When I logout of my application I redirect to the login page. However the
ReturnURL is placed in the querystring so if the user logs back in it goes
back to the last page where the logout occured. The behavior I'm looking
for is to only use the ReturnURL if the Session timesout.
Logout event found on every page in the application:
Private Sub btnLogout_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnLogout.Click
UpdateItem()
If (User.Identity.IsAuthenticated) Then
System.Web.Security.FormsAuthentication.SignOut()
End If
Session.Abandon()
Response.Redirect("default.aspx")
End Sub
Login on default.aspx:
....check login credentials, if ok then
FormsAuthentication.SetAuthCookie(txtUserName.Text, False)
If Request.QueryString("ReturnURL") = Nothing Then
Response.Redirect("private/app_start.aspx")
Else
FormsAuthentication.RedirectFromLoginPage("txtUserName.Text", False)
End If
ReturnURL is placed in the querystring so if the user logs back in it goes
back to the last page where the logout occured. The behavior I'm looking
for is to only use the ReturnURL if the Session timesout.
Logout event found on every page in the application:
Private Sub btnLogout_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnLogout.Click
UpdateItem()
If (User.Identity.IsAuthenticated) Then
System.Web.Security.FormsAuthentication.SignOut()
End If
Session.Abandon()
Response.Redirect("default.aspx")
End Sub
Login on default.aspx:
....check login credentials, if ok then
FormsAuthentication.SetAuthCookie(txtUserName.Text, False)
If Request.QueryString("ReturnURL") = Nothing Then
Response.Redirect("private/app_start.aspx")
Else
FormsAuthentication.RedirectFromLoginPage("txtUserName.Text", False)
End If