# ISession

Description:

`ISession` is provided by the `Server` interface after a successful login. Session represents an open connection to a server. It provides the possibility to call server jobs.
```cpp
import "OxSvrSpt.idl"
```
Public Methods:
```cpp
HRESULT Logout ()
HRESULT NewJob ([in] BSTR Name, [out, retval] IJob ** ppJob)
HRESULT CreateJobSink ([out, retval] VARAINT * pJobSink)
HRESULT SetCallBack ([in] long ICallbackType, [in] IDispatch * pUnkSink, [in] long IUserData)
```
Properties:
```cpp
IProperties Properties [get]
ILicenses Licenses [get]
```
Documentation of Element Functions:

* `HRESULT CreateJobSink ([out, retval] VARAINT * pJobSink)`

`CreateJobSink` returns the `IJobSink` interface of the underlying OxSvrCom library.

Parameters:

: `pJobSink` (VB return parameter) created `IJobSink` interface

* `HRESULT Logout ()`

`Logout` ends work with this `Session`.

After a `Session` logout, all accesses to the other methods and properties of the `Session` throw the error `errNoSession`.

Exception handling:

`errNoSession` (1501) The underlying `Session` is no longer available. This `Session` was either closed or the session object was released.

* `HRESULT NewJob ([in] BSTR Name, [out, retval] IJob ** ppJob)`

`NewJob` creates a new job object for the job with the passed name

Parameters:

: `Name` name of the job. This consists of Engine.Job

: `ppJob` (VB return parameter) contains the created job object

* `HRESULT SetCallBack ([in] long ICallbackType, [in] IDispatch * pUnkSink, [in] long IUserData)`

`SetCallBack` sets the `IJobSink` interface for callbacks in the underlying OxSvrCom library.

Parameters:

: `ICallbackType` documentation for `ICallbackType`

: `pUnkSink` documentation for `pUnkSunk`

: `IUserData` documentation for `IUserData`

Documentation of Properties:

* `ILicenses Licenses [get]`

`Licenses` returns the collection of currently logged-in licenses.

Parameters:

: `pVal` (VB return value) returns a COM collection with the licenses

* `IProperties Properties [get]`

`Properties` returns server and session properties for this object.

Parameters:

: `pVal` (VB return value) returns a COM collection with the relevant properties. The collection contains objects of type `IProperty`
