Exemplo n.º 1
0
        IIdentity IIdentityManager.ReadIdentity()
        {
            var primary   = _httpContext.Request.Headers[_options.IdKey];
            var secondary = _httpContext.Request.Headers[_options.AnonymousIdKey];

            return(IdentityReader.GetIdentity(primary, secondary, _options));
        }
Exemplo n.º 2
0
        IIdentity IIdentityManager.ReadIdentity()
        {
            var primary   = _httpContext.Session.GetString(_options.IdKey);
            var secondary = _httpContext.Session.GetString(_options.AnonymousIdKey);

            return(IdentityReader.GetIdentity(primary, secondary, _options));
        }
Exemplo n.º 3
0
        IIdentity IIdentityManager.ReadIdentity()
        {
            _httpContext.Request.Cookies.TryGetValue(_options.IdKey, out var primary);
            _httpContext.Request.Cookies.TryGetValue(_options.AnonymousIdKey, out var secondary);

            var identity = IdentityReader.GetIdentity(primary, secondary, _options);

            if (_options.SessionMode && IsLifeSessionLost())
            {
                identity.Id = 0;
            }
            return(identity);
        }