How do I get user's session ID?

I’m creating a button that will launch a DrawLoop function to generate a nice doc for printing in another window, but it needs the current user’s Salesforce session ID. How do I access that?

The Session Id and some other Api related merge variables are accessible through Skuid merge syntax:

{{$Api.Session_Id}} {{$Api.Partner_Server_Url}} {{$Api.Enterprise_Server_Url}}