title: Prepending on load if cookie exists
body: <p>I have a <code>div</code> which contains multiple <code>a</code> tags each of which contains a unique <code>href</code> attribute. Each link is marked with a check mark upon click. I am trying to set up a session cookie for the click, such that when the user navigates away from and back to the page, the check mark indicating a followed link is still present. I have set up an array (<code>strArray</code>), which banks cookies by converting the <code>history</code> object to a string and using the <code>.push()</code> method, to check against an array of <code>hrefs</code> generated via:</p>
  
  <pre><code>var urlArray = $(".holder a").map(function() {
    return $(this).attr("href");
  }).get();
  </code></pre>
  
  <p>I cannot figure out why the <code>strArray</code> is continuously being rewritten upon clicking a link or if my script is achieving the desired result, that is, if it is in fact prepending links after navigating away from the page and back again. Can anyone point me in the right direction?</p>
  
  <p>See my fiddle here: <a href="https://jsfiddle.net/tfrx9tyf/19/" rel="nofollow">https://jsfiddle.net/tfrx9tyf/19/</a></p>