I have been tasked with making sure our website login page runs through HTTPS. How the site works is no matter what page you are on you can click the login link, a pop-up modal box opens front and center with login form (login.aspx). Once you login that box goes away and the user is taken back to the page they were on as an authenticated user. This process works just fine, until I throw HTTPS in the way.
What I did on the login.aspx.cs page_load event was added:
This part seems to work fine, once the login pop-up comes up I know it's now in HTTPS and the login function works fine...however the login box doesn't go away any longer. The form goes away but there is the background of login.aspx still sitting there. Here is the code that seemingly is supposed to make that pop-up disappear (also i have screen capture attached):
location = window.parent.location;}</
I'm pretty sure I know what the problem is, but I don't know how to fix it. The very last else it's setting the parent location (which should be the original page that called up the login), however my code to redirect to HTTPS I believe is changing that value and it's just trying to call itself as the parent location thus causing that frame to stay up and not go back to the original page. I don't want to hard-code a parent location because I would like it to return back to the page the customer was on.