namespace Fest.WebClient
{
    public static class SessionExtension
    {
        public static string GetXClientId(this ISession session)
        {
            var value = session.GetString("XClientIdSessionKey");
            if (value == null)
            {
                Guid key = Guid.NewGuid();
                value = key.ToString();
                session.SetString(XClientIdSessionKey, value);
            }

            return value;
        }

        private const string XClientIdSessionKey = "XClientIdSessionKey";
    }
}
