title: Legacy code: window.parent.location.href="https:/home"
body: <p>I have inherited some code from our former developer and I found this piece of code.</p>
  
  <pre><code>&lt;?php
     if($this-&gt;loginAction-&gt;isAuthenticated()){
  ?&gt;
     &lt;script type="text/javascript"&gt;
        window.parent.location.href="https:/home";
     &lt;/script&gt;
  &lt;?php
  }
  ?&gt;
  </code></pre>
  
  <p>I have been looking on it for a while and I have no idea why he put there the shortcut for the URL. I think that the URL should be <a href="https://mysite.com/home" rel="nofollow">https://mysite.com/home</a>. I basically don't know what does this code do.</p>
  
  <p><strong>Edit:</strong> I know that this code is redirection if user is authenticated, but I don't know what the strange URL(https:/home) is doing there. This code is working.</p>
  
  <p>Thank you for any help.</p>
  
  <p><strong>Edit2:</strong> According to my colleague, this is one of the JS secrets:) Going to test it. This two lines of code should have equal functionality:</p>
  
  <pre><code>window.parent.location.href="https:/home";
  window.parent.location.href="https://www.my-testing.com/home";
  </code></pre>