The best solution is to put it in a session cookie, which will be passed with the AJAX requests and can be interpreted by the server. No changes needed to any JavaScript AJAX requests.
The next would be more complicated. You could write a jQuery.ajaxSend()
function that checks the request url (to make sure it's one you need to add the session ID to) and add the sessionID to the data object before the AJAX request is made.