When using the UpdateAsync method to update an entry, the TTL gets updated to no limit even if I pass a TTL value. As a workaround, I need to delete the entry and recreate it:
await this._sessionCollection.UpdateAsync(new CachedServerSideSession(session), session.Expires - DateTime.UtcNow ?? TimeSpan.Zero);
TTL is set to no limit.
await this.DeleteSessionAsync(session.Key, cancellationToken);
await this.CreateSessionAsync(session, cancellationToken);
TTL has the right value.