ServiceStack IAuthSession blank after login

c#, servicestack

Solution

Fixed it!!

Thank Eli Gassert. Following his hint, I suspect the MemcachedClient wasn't setup properly. So I switched it to simple MemoryCacheClient.

Everything instantly works properly now. Because MemcachedClient wasn't remembering anything. So there was no session at all.

Problem

So, I run debug on `localhost/auth/credential` with auth feature, and successfully logged in with `user=admin, pass=pass, rememberMe=true`. I got a Json response `UserName=admin, SessionId=1`, so far so good. Then I have a `SessionService` to check my current Session: ``` [Route("user/session")] public class Session { } public class SessionResponse { public ResponseStatus ResponseStatus { get; set; } public string UserName { get; set; } public string SessionId { get; set; } } class SessionService : Service { public dynamic Get(Session req) { IAuthSession session = this.GetSession(); return new SessionResponse() { SessionId = session.Id, UserName = session.UserName, }; } } ``` But when I go visit : `localhost/user/session` I got SessionId = K16UMnr2eBXiIFUwAod, UserName = null where I expected UserName=admin. I am stuck with this for hours, can't figure out what I am doing wrong. Please help? UPDATE ============================================================== When I login, browser received: ``` X-UAId=1 ``` then browser sent: ``` ss-pid=zV7OOe2sP8hwlo8rR0EZ ss-id=K16UMnr2eBXiIFUwAod X-UAId=1 ``` as the picture shows: URL: localhost/auth/credentials?format=json Then I visit the session service: URL: localhost/user/session As you can see, I am picking up the ss-id as SessionId. I am logged in with admin, UserName=admin is expected, but I got UserName=null. Why is it?

Original source