jQuery / PHP mix up
<p>I have the following jQuery function in my PHP:</p>

<pre><code>echo ' 
function myFunction() {
    return $.ajax({
        type: "POST",
        url: "mypage.php",
        data: "name=John&amp;location=Boston"
    });
}

$.when(myFunction()).then(function(data) {
     // handle data return
     someOtherFunction(data);

     // need to set "data" var into PHP SESSION


}, function(error) { 
     // handle ajax error.
});
';
</code></pre>

<p>After my AJAX does the majic it returns a value (data), which I pass into another function. In addition I need to be able to set that value into a PHP session:
<strong>$_SESSION['project'][data] = data;</strong></p>

<p>How do I do that? The switching between PHP and JS confuses me for some reason...</p>
