Skip to main content

Logout

Invalidates the current session, releasing server-side resources associated with the SessionID.

:::caution Established API The SOAP API is in maintenance mode. For new integrations use the REST equivalent. :::

Method Signature

bool Logout(string SessionID)

Parameters

ParameterTypeRequiredDescription
SessionIDstringYesActive session token obtained from Login

Response

Returns true if the session was successfully invalidated, false if the session was already expired or not found.

<!-- Example response -->
<LogoutResponse xmlns="http://www.ecgridos.net/">
<LogoutResult>true</LogoutResult>
</LogoutResponse>

Code Examples

// .NET 10 — dotnet-svcutil generated proxy
// Always call Logout in a finally block to guarantee cleanup
using var client = new ECGridOSClient(binding, endpoint);

string sessionID = await client.LoginAsync(/* credentials */);

try
{
// Perform API operations...
var info = await client.WhoAmIAsync(sessionID);
}
finally
{
// Releases the session on the server regardless of success or failure
bool loggedOut = await client.LogoutAsync(sessionID);
}

:::tip Best practice Always call Logout in a finally block. Orphaned sessions consume server-side resources and may count against concurrent session limits on your account. :::

REST Equivalent

See LogoutPOST /v2/auth/logout.