locked
Sign out RRS feed

  • Question

  • I am running this code when a user clicks on 'sign out' link on my app, but if the same user then clicks 'Sign in', instead of going to the login.live page it automatically signs in with the previous credentials. How do I force sign out so that sign in always goes to the login.live page

    FormsAuthentication

     

    .SignOut();

    Response.Redirect(

    "../default.aspx");

    Thanks.

    Friday, January 15, 2010 7:44 PM

Answers

  • Hi,

    From your application after clicking on sign out, you can mention the page where you need to get redirect by specifying the value for WCPage_ActionSignOut in your web config file.

    Here is a sample code for that

    SignOut
    // Link button in .aspx
    <asp:LinkButton ID="lnkSignOut" runat="server" OnClick="lnkSignOut_Click">Sign Out</asp:LinkButton>

    // Event Handler in code
    protected void btnSignOut_Click(object sender, EventArgs e)
    {
       this.SignOut();
    }
    The value should be set in web.config file, that you want to redirect, clicking on signout
    <add key="WCPage_ActionSignOut" value="Default.aspx"/>

    Thank you,

    Anish Ravindran
    Friday, January 15, 2010 8:06 PM
  • Hello,

    After clicking on Sign Out, the application will redirect to HV Login page which is an expected behavior as your default.apsx is derived from HealthServicePage. Can you please ensure that you have Signed Out before closing the browser as I'm not able to reproduce it?

    Thank you,
    Anish Ravindran
    Friday, January 15, 2010 10:27 PM

All replies

  • Hi,

    From your application after clicking on sign out, you can mention the page where you need to get redirect by specifying the value for WCPage_ActionSignOut in your web config file.

    Here is a sample code for that

    SignOut
    // Link button in .aspx
    <asp:LinkButton ID="lnkSignOut" runat="server" OnClick="lnkSignOut_Click">Sign Out</asp:LinkButton>

    // Event Handler in code
    protected void btnSignOut_Click(object sender, EventArgs e)
    {
       this.SignOut();
    }
    The value should be set in web.config file, that you want to redirect, clicking on signout
    <add key="WCPage_ActionSignOut" value="Default.aspx"/>

    Thank you,

    Anish Ravindran
    Friday, January 15, 2010 8:06 PM
  • Thanks. Sign out worked with the above answer but it takes me to login.live page instead of the default.aspx.
    When I close my browser and open again, signin takes previous credentials instead of going through login.live page.
    How do I resolve that? i want my signin to always go through logi.live..

    Thank you.
    Friday, January 15, 2010 9:02 PM
  • Hello,

    After clicking on Sign Out, the application will redirect to HV Login page which is an expected behavior as your default.apsx is derived from HealthServicePage. Can you please ensure that you have Signed Out before closing the browser as I'm not able to reproduce it?

    Thank you,
    Anish Ravindran
    Friday, January 15, 2010 10:27 PM