title: jQuery Tab Menu with Remember Last Position
body: <p>I have <code>jQuery</code> tab menu call ajax.</p>
  
  <p>Menu is working perfect, now How can I set the tab automatically detect last tab click even page refreshed.</p>
  
  <p>You can see the fiddle here: <a href="https://jsfiddle.net/waspinator/rw8ujfg3/" rel="nofollow noreferrer">https://jsfiddle.net/waspinator/rw8ujfg3/</a></p>
  
  <pre><code>&lt;ul class="nav nav-tabs tabs-up " id="friends"&gt;
    &lt;li active&gt;&lt;a href="/gh/gist/response.html/3843293/" data-target="#contacts" class="media_node active span" id="contacts_tab" data-toggle="tabajax" rel="tooltip"&gt; Contacts &lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/gh/gist/response.html/3843301/" data-target="#friends_list" class="media_node span" id="friends_list_tab" data-toggle="tabajax" rel="tooltip"&gt; Friends list&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/gh/gist/response.html/3843306/" data-target="#awaiting_request" class="media_node span" id="awaiting_request_tab" data-toggle="tabajax" rel="tooltip"&gt;Awaiting request&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>  &lt;div class="tab-content"&gt;
    &lt;div class="tab-pane active" id="contacts"&gt;
  
    &lt;/div&gt;
    &lt;div class="tab-pane" id="friends_list"&gt;
    &lt;/div&gt;
    &lt;div class="tab-pane  urlbox span8" id="awaiting_request"&gt;
  
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JS</p>
  
  <pre><code>$('[data-toggle="tabajax"]').click(function(e) {
  var $this = $(this),
      loadurl = $this.attr('href'),
      targ = $this.attr('data-target');
  
  $.get(loadurl, function(data) {
      $(targ).html(data);
  });
  
  $this.tab('show');
  return false;
  });
  </code></pre>
  
  <p>I just know it will be using cookie right? But how can I set it?</p>