How to clear C# client cached session

It looks like the C# client uses the dotnet CookieContainer - I can’t seem to find any documentation on how to clear that… It would also be instructive to understand the thinking behind using cookies when you authenticate with JWT token anyway.

You can always assign a new CookieContainer, e.g:

client.CookieContainer = new CookieContainer();

From JWT docs:

Using Cookies is the recommended way for using JWT Tokens in Web Applications since the HttpOnly Cookie flag will prevent it from being accessible from JavaScript making them immune to XSS attacks whilst the Secure flag will ensure that the JWT Token is only ever transmitted over HTTPS.

But if this is for the C# Client you can just send it in a BearerToken as normal.

var client = new JsonServiceClient(baseUrl) {
    BearerToken = jwtToken
};