Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6044437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:00:43+00:00 2026-05-23T07:00:43+00:00

I have an issue with mixing HTTP/HTTPS portions of my site which is a

  • 0

I have an issue with mixing HTTP/HTTPS portions of my site which is a bit hard to explain. Basically, the site is structured so that:

  • Homepage and public content pages are sent via HTTP
  • All pages which require authorization are sent via HTTPS

I’m adding a “Remember Me” feature to the site in which a session key is sent in a secure cookie to the user. This has worked great for the authorized areas (HTTPS) of the site — I can delete the PHP session for the user and it will be recreated by the secure session key cookie when I visit those authorized pages again.

I have a login button on the pages of the site which are sent unencrypted. This login button launches a modal window, and this modal window’s contents are transferred via HTTPS. The secure session key cookie is sent in the request for this modal window since it’s over a secure connection. If this session key cookie is detected, I need to close the modal window and redirect the parent page to the authorized section of the site.

// this script running on https://somewhere.com/account/ in an iframe
// whose parent is http://somewhere.com/ (non-HTTPS)
<?php if ( $already_authorized ): ?>
    <script type="text/javascript">
        $(document).ready(function redirectParent() {
            parent.jQuery.fancybox.close();
            parent.window.location.href = 'https://somewhere.com/account/';
        });
    </script>
<?php endif ?>

I’m running into problems with cross-domain scripting prevention, though, since the modal window loading from https://somewhere.com/account/ is trying to execute a JS function on its parent window, http://somewhere.com.


So, my dilemma in short form:

  • Unsecured pages contain links to a modal login window, which loads via HTTPS
  • Modal login window can check for session key cookie, since it’s sent over a secure connection
  • Modal login window can’t tell its parent to close with JS, however, because it was loaded over a different protocol
  • Modal login window can’t load via an unsecured connection. This would give JS access to the parent, but then the secure cookie wouldn’t be available.

If my question makes enough sense, I’d like to know: is there any way to get around this frustrating problem? Or am I just going to end up making the entire site (both public and private sections) load via HTTPS?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:00:44+00:00Added an answer on May 23, 2026 at 7:00 am

    I found a solution! It’s probably not the most elegant, but it works and maintains the same level of security as far as I can see.

    • On login, store two cookies.
      1. Secure cookie which contains session key
      2. Unsecured cookie which stores an ‘authorized’ state: true or false
    • On unsecured pages, check for the unsecured cookie.
      • If the unsecured cookie’s value is true, assume the user is authorized and display links to the secure “My Account” page (non-modal).
      • Once the user visits the “My Account” page via HTTPS, the secure cookie is checked. If everything’s good, the page is displayed as normal. If the session key is nonexistent or doesn’t validate, both cookies are deleted and the user is redirected to the homepage.
    • On secure pages, the process remains the same — a check is run for the secure session key cookie.
    • On logout, invalidate both cookies.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an issue that is driving me a bit nuts: Using a UserProfileManager
I have issue with a strange url request to my site.. that may come
I have issue that is reproduced on g++. VC++ doesn't meet any problems. So
I have an issue with watin test that should browse for pdf and upload
i have done drag and drop using with jquery. here i have issue that
I have issue where i want to create Dynamic function which will do some
I have issue with a value that should have just work, however, it seem
I have a data-mining application that accesses a web-site to retrieve records on an
I have a batch script that invokes PLSQL with connection details, which works fine
I have issue with Win2003 that Java Applet Closes IE for Users not Admins.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.