Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The scenario you are describing should be working correctly unless the logout page is not actually deleting the forms authentication cookie. There are several ways to end the forms authentication session:</p> <pre><code>//I have seen instances where this does not work. FormsAuthentication.SignOut() //I have not seen this code fail before. Dim cookie As HttpCookie = FormsAuthentication.GetAuthCookie( _ HttpContext.Current.User.Identity.Name, False) cookie.Expires = Date.Now.AddDays(-1) Response.Clear() Response.AppendCookie(cookie) Response.Redirect(FormsAuthentication.LoginUrl) </code></pre> <p>Also if you are using a role manager which stores in a cookie remember to call Roles.DeleteCookie().</p> <p><b>Edit:</b> In response to the updated question. </p> <p>The Response.Redirect method does not return a header with a new URL referrer because the spec says that only client initiated requests should contain a referrer header. Here is the Response.Redirect code which you can see does not change the referrer header:</p> <pre><code>Public Sub Redirect(ByVal url As String, ByVal endResponse As Boolean) If (url Is Nothing) Then Throw New ArgumentNullException("url") End If If (url.IndexOf(ChrW(10)) &gt;= 0) Then Throw New ArgumentException(SR.GetString("Cannot_redirect_to_newline")) End If If Me._headersWritten Then Throw New HttpException(SR.GetString("Cannot_redirect_after_headers_sent")) End If Dim handler As Page = TryCast(Me._context.Handler,Page) If ((Not handler Is Nothing) AndAlso handler.IsCallback) Then Throw New ApplicationException(SR.GetString("Redirect_not_allowed_in_callback")) End If url = Me.ApplyRedirectQueryStringIfRequired(url) url = Me.ApplyAppPathModifier(url) url = Me.ConvertToFullyQualifiedRedirectUrlIfRequired(url) url = Me.UrlEncodeRedirect(url) Me.Clear If (((Not handler Is Nothing) AndAlso handler.IsPostBack) AndAlso (handler.SmartNavigation AndAlso (Me.Request.Item("__smartNavPostBack") = "true"))) Then Me.Write("&lt;BODY&gt;&lt;ASP_SMARTNAV_RDIR url=""") Me.Write(HttpUtility.HtmlEncode(url)) Me.Write("""&gt;&lt;/ASP_SMARTNAV_RDIR&gt;") Me.Write("&lt;/BODY&gt;") Else Me.StatusCode = &amp;H12E Me.RedirectLocation = url If ((url.StartsWith("http:", StringComparison.OrdinalIgnoreCase) OrElse url.StartsWith("https:", StringComparison.OrdinalIgnoreCase)) OrElse ((url.StartsWith("ftp:", StringComparison.OrdinalIgnoreCase) OrElse url.StartsWith("file:", StringComparison.OrdinalIgnoreCase)) OrElse url.StartsWith("news:", StringComparison.OrdinalIgnoreCase))) Then url = HttpUtility.HtmlAttributeEncode(url) Else url = HttpUtility.HtmlAttributeEncode(HttpUtility.UrlEncode(url)) End If Me.Write("&lt;html&gt;&lt;head&gt;&lt;title&gt;Object moved&lt;/title&gt;&lt;/head&gt;&lt;body&gt;" &amp; ChrW(13) &amp; ChrW(10)) Me.Write(("&lt;h2&gt;Object moved to &lt;a href=""" &amp; url &amp; """&gt;here&lt;/a&gt;.&lt;/h2&gt;" &amp; ChrW(13) &amp; ChrW(10))) Me.Write("&lt;/body&gt;&lt;/html&gt;" &amp; ChrW(13) &amp; ChrW(10)) End If Me._isRequestBeingRedirected = True If endResponse Then Me.End End If End Sub </code></pre> <p>You can use reflector to follow the other methods but I don't see one which changes any header.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload