Skip to main content
Version: 16.10.0

GW2OpenSession

The Glasswall library is session based. Sessions act as a means to store data against a session ID. The GW2OpenSession function creates a new session.

Synopsis

Create a new session and returns the session ID

#include "glasswall.core2.api.h"
Session GW2OpenSession(void);

Returns

If successful, the GW2OpenSession function returns a handle, a small positive integer that designates the session. The handle is used as an argument to other API functions to identify the session. If the call fails, the handle will be zero.

Example


#include "glasswall.core2.api.h"

Session session = GW2OpenSession();

if (!session)
/* deal with error */
else
/* use session to refer to the session in other API function calls */

if (GW2CloseSession(session))
/* error closing session */