colinb
Member
Logging out from your session
Looks like you make an HTTP DELETE call to /Logout with the _s_portal_session and user_credentials cookies set to logout:
Looks like you make an HTTP DELETE call to /Logout with the _s_portal_session and user_credentials cookies set to logout:
Code:
var logoutAddress = new UriBuilder(baseAddress) { Path = "/logout" };
var httpClientHandler = new HttpClientHandler();
httpClientHandler.CookieContainer.Add(logoutAddress.Uri, new Cookie("_s_portal_session", sessionCookie));
httpClientHandler.CookieContainer.Add(logoutAddress.Uri, new Cookie("user_credentials", token));
var httpClient = new HttpClient(httpClientHandler);
var response = await httpClient.DeleteAsync(logoutAddress.Uri);
response.EnsureSuccessStatusCode();