Exemple #1
0
        public string GetAdditionalData(HttpContext context)
        {
            var newToken = TokenGenerator.GetRandomToken();

            if (newToken.Contains(Separator))
            {
                newToken = newToken.Replace(Separator.ToString(), string.Empty); //to prevent collision
            }

            List <string> existingTokens = GetTokens(context);

            if (existingTokens.Count == AmountOfSessionTokens)
            {
                existingTokens.RemoveAt(0);
            }

            existingTokens.Add(newToken);
            SetTokens(context, existingTokens);

            return(newToken);
        }