You would call
$.ajax()[
^], which is jQuery's easy way of calling a web service.
Then you'll need a WebMethod that will take 2 Strings, the Session variable name and the session value you want to set it to.
Also, make sure to enable the session in your webmethod, like this:
[WebMethod(EnableSession = true)]
because by default, you won't be able to access the session without that.