0

Good afternoon everyone! I am already logged in to my ASP website that uses C# code behind however, when I go to another page it triggers a popup and the popup wants me to re-login, how do I cause the popup to already be logged in to my session?

am using the following code in page_load to trigger the popup:

        if (!IsPostBack)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "OpenWindow", "window.open('http://website', 'target=_blank');", true);
        }
Christopher
  • 169
  • 1
  • 2
  • 10

1 Answers1

1

You are only checking if !IsPostBack, you also need to check if the Context.User.IsAuthenticated

Which means, Forms Authentification (or other), IIdentity, IPrincipal, and tralala

Check this out ASP.NET MVC - Set custom IIdentity or IPrincipal

Community
  • 1
  • 1
Robert Hoffmann
  • 2,366
  • 19
  • 29