I have the following code in my Visual Studio 2010 C # Web Application. The web application supports Windows Authentication in IIS.
<script runat="server"> void Signout_Click(object sender, EventArgs e) { FormsAuthentication.SignOut(); Response.Redirect("WebForm1.aspx"); } </script> <body> <form id="form1" runat="server"> <div> <span class="style1"><strong> <asp:HyperLink ID="Link_Home" runat="server" NavigateUrl="~/WebForm1.aspx">Home</asp:HyperLink> | <asp:Button ID="Submit1" OnClick="Signout_Click" Text="Sign Out" runat="server" /> </strong></span><br /> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> </div> </form> </body> </html>
However, I noticed that FormsAuthentication.SignOut(); doesn't seem to work. This is because when I click the button. It is supposed to log out and clear the current user, so that when another user comes to this page, he must request a password.
However, when I open another tab and enter the URL of the web application, it does not ask me for a username or password. Only when the web browser closes and reopens with the URL of the web application does it request a username and password.
Appreciate if anyone can help me.
authentication visual-studio-2010
Jack 05 Oct '12 at 8:22 2012-10-05 08:22
source share