The IScriptingContext::get_Session method retrieves a pointer to the ISessionObject interface of the Session object.
HRESULT get_Session(
ISessionObject ** ppSession //pointer to an ISessionObject
// interface pointer
);
You can use the ISessionObject interface to access variables and objects that have been given session scope.