After further testing, it looks like the code is not getting the Session ID correctly. I hard-coded the session id for testing purposes and it returned the processes active for that session.

But I'm not sure how to fix the session id retrieval code.