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

  • SEARCH
  • Home
  • 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 5954357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:57:34+00:00 2026-05-22T17:57:34+00:00

i can, thru code (javascript) automatically navigate to a site and have my hidden

  • 0

i can, thru code (javascript) automatically navigate to a site and have my hidden credentials get me in with no problem (and have the cookie)

however, on the next line of code when i try to redirect using (window.open) it doesn’t recognize that i’ve already got the cookie and then prompts me for credentials. Any ideas?

...
    <form name="MyForm" action="#" method="post">
        <input type="hidden" name="blah" value="blah" />
        <input type="hidden" name="blah" value="blah" />
    </form>
</div>
  • 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-22T17:57:35+00:00Added an answer on May 22, 2026 at 5:57 pm

    Using JavaScript we can communicate between browser windows given that we have a reference to each window. When a new window is created the the JavaScript method window.open() it returns a reference to the new window. The child window, also has a reference to the parent window that created it via the window.opener window object. These references allow the two windows to communicate with and manipulate each other.

    To demonstrate how communicating between windows with cookies would work, lets assume we want to open a window, and then close it a few seconds later.
    view plainprint?

     1. var win = window.open('child.html');  
     2. setTimeout(function() { win.close(); }, 5000);  
    
    var win = window.open('child.html');
    setTimeout(function() { win.close(); }, 5000);
    

    The code will open a child window, and close it after 5 seconds using the reference to the child window and the method close(). However if we didn’t have a reference for some reason, we would not be able to invoke the close method. So lets see how it could be done with cookies:
    view plainprint?

     1. window.open('child.html');  
     2. setTimeout(function() { setCookie('child', 'close'); }, 5000);  
    
    window.open('child.html');
    setTimeout(function() { setCookie('child', 'close'); }, 5000);
    

    Here we open a window but do not save a reference. Then after 5 seconds we write ‘close’, to the cookie named ‘child’ (using the pseudo setCookie() function). This does not do anything by itself, but if the child window was expecting the cookie, it could close itself when it read ‘close’. Lets assume the following JS is in child.html.
    view plainprint?

    1. // child.html  
    2. setInterval(function() { getCookie('child') == 'close' ? this.close() : ''; }, 500);  
    
    // child.html
    setInterval(function() { getCookie('child') == 'close' ? this.close() : ''; }, 500);
    

    This would check the cookie every half a seconds and close the window if the cookie read ‘close’.

    Using this method we can send any commands to any open windows and have them execute it without having a reference to that window.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can i get the source code for a WAMP stack installer somewhere? Any help
I'm about to put my head thru this sliding glass door. I can't figure
Can I get a 'when to use' for these and others? <% %> <%#
I have this code in some of my ASCX files: <%=Html.ActionLink(Resources.Localize.Routes_WidgetsEdit, Edit, Widget, new
I have a webpage on my site that displays a table, reloads the XML
I am attempting to create a php script that can connect thru ssh to
How to know GDG base properties through REXX code; Of course we can view
I have a Windows Service that is exposing a WCF service thru a net.tcp
I need to solve the following question which i can't get to work by
If all tables I want to delete from have the column gamer_id can i

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.