Hi, I’ve got a backend running asp.net core and ServiceStack with MemoryCacheClient, custom CredentialsAuthProvider and custom user session.
I’m trying to save some data in the auth user session from a request and then use that data while gathering data for other requests.
The problem I’m running into is that what I save in the session seems to disappear by the next request, in my custom
OnAuthenticatedAsync() it seems to just be a fresh session every time(as evidenced by the CreatedAt timestamp) even tho the requests are coming from the same client.
In the request service I’m getting the session with:
var session = await base.SessionAsAsync<EhrAuthUserSession>();
setting data with:
session.AsRelative = true;
and saving with:
In the auth methods getting it like this:
var session = (EhrAuthUserSession)await authService.GetSessionAsync(false, token);
var realSession = session as EhrAuthUserSession;
OnSaveSessionAsync() I can see that it does get saved with the data I set but again by the next request it’s gone.
I’ve spent a lot of time combing through the docs trying to figure out why this is happening but I can’t seem to find the issue.
I’m not the one who initially set up ServiceStack in the project so it could be a configuration setting or something I’m not aware of but I can’t find anything that isn’t according to the docs.
If anyone can help me out or point in the right direction that would be great.