title: Setting cookie when link clicked
body: <p>So there's this plugin for wordpress, Transposh: <a href="http://transposh.org/" rel="nofollow">http://transposh.org/</a> its basically a translation engine.
  I have this site i'm owrking on where when a user visits the site the site checks for Transposh's Language preference cookie like this:</p>
  
  <pre><code>&lt;?php if( isset( $_COOKIE['TR_LNG'] ) ) {} else { ?&gt;
  </code></pre>
  
  <p>and if the cookie (called TR_LNG) is not found it proceeds to show a language selection dialogue, that has links to both English and French versions of the site. The problem is transposh's own widget sets the default language like this: the suer selects language on widget. Widget loads required language page and displays a link below the widget that says Set this language as default.
  The link looks like this:</p>
  
  <pre><code>&lt;a id="tr_setdeflang" class="tr_setdeflang" onclick="return false;" href="http://sarvatma.org/wp-admin/admin-ajax.php?action=tp_cookie_bck"&gt;Set this lang....&lt;/a&gt;
  </code></pre>
  
  <p>what I need to happen is, when a user clicks a language in the language preference dialogue that looks like this:</p>
  
  <pre><code>&lt;a href="http://www.sarvatma.org/en/"&gt;In English&lt;/a&gt;
  </code></pre>
  
  <p>I need it to also set the language, English in the above example as the default. That's the best I can explain my situation, if you need anymore info just let me know.</p>