In the ServiceStack session documentation here:
https://github.com/ServiceStack/ServiceStack/wiki/Sessions
there is some example code that defines a UserSession property. I expected that the setter for the property would add the newly-created data storage object to the cache. Is that missing from this sample code? Or is there some other place the session data is added to the cache?
Also, why do we have both a sessionId and a sessionKey? Wouldn’t the latter be sufficient? And we create multiple Ids (CreateSessionIds) but only ever use one (GetSessionId)?
SessionId is just the hashed Guid, SessionKey is the unique fully-qualified key that’s used when referencing the session in the datastore (e.g. Redis).
There exists both transient and permanent session keys defined and the one used is specified by the
ss-optcookie and can be changed by the client at anytime.