import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'


The  **GW2CloseSession**  function closes the session designated by  **session**. All resources allocated by the
session will be destroyed. Only data stored to persistent storage can be processed by the client after a successful
call to  **GW2CloseSession**.


<Tabs>

<TabItem value="C++" label="C++" default>

**Synopsis**
```cpp
#include "glasswall.core2.api.h"
int GW2CloseSession(Session session);
```

**Returns**

The **GW2CloseSession** function returns a **GW2_RetStatus** enumeration converted to `int`. The value will be negative if an error occurred. `0` indicates success. Refer to the API Overview/Return types for details. 

</TabItem>

<TabItem value="C#" label="C#">

**Synopsis**

```csharp
public int CloseSession(int session)
```

**Returns**

Returns an integer `GW2_RetStatus` enum value. Negative numbers indicate a failure.

</TabItem>
<TabItem value="Java" label="Java">

**Synopsis**

```java
import com.glasswall.core2javabridge.*;

public int GW2CloseSession(int session)
```

**Returns**

The **GW2CloseSession** function returns a **GW2_RetStatus** enumeration converted to **int**. The value will be negative if an error occurred. `0` indicates success. Refer to the API Overview/Return types for details. 

</TabItem>

<TabItem value="Python" label="Python">

**Synopsis**

```py
def close_session(self, session: int) -> int:
    """ Close the Glasswall session. All resources allocated by the session will be destroyed.

    Args:
        session (int): The session to close.

    Returns:
        status (int): The status code of the function call.
    """
```

**Returns**

Returns an integer `GW2_RetStatus` enum value. Negative numbers indicate a failure.

</TabItem>

<TabItem value="JavaScript" label="JavaScript">

**Synopsis**

```jsx
GW2CloseSession(session)
```

**Returns**

Returns an integer `GW2_RetStatus` enum value. Negative numbers indicate a failure.

</TabItem>

</Tabs>