예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="cookieName"></param>
        public static void ClearCookie(Enum cookieName)
        {
            ConfigCookieEntry cookieInfo = GetConfigCookieEntry(CookieNameHelper.GetName(cookieName));

            CookieHelper.ClearCookie(CookieNameHelper.GetName(cookieName), CookieNameHelper.GetSubName(cookieName)
                                     , cookieInfo.Domain, cookieInfo.Path);
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="cookieName"></param>
        /// <param name="value"></param>
        public static void SetCookieValue(Enum cookieName, string value)
        {
            ConfigCookieEntry cookieInfo = GetConfigCookieEntry(CookieNameHelper.GetName(cookieName));

            if (cookieInfo.HasSubKey)
            {
                string subName = CookieNameHelper.GetSubName(cookieName);
                CookieHelper.SetCookie(cookieInfo.Name, subName, value, cookieInfo.Domain, cookieInfo.Path, cookieInfo.HttpOnly, cookieInfo.SecureOnly, cookieInfo.ExpiresAfter);
            }
            else
            {
                CookieHelper.SetCookie(cookieInfo.Name, value, cookieInfo.Domain, cookieInfo.Path, cookieInfo.HttpOnly, cookieInfo.SecureOnly, cookieInfo.ExpiresAfter);
            }
        }
예제 #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="cookieName"></param>
        /// <returns></returns>
        public static string GetCookieValue(Enum cookieName)
        {
            string cookieStringName = CookieNameHelper.GetName(cookieName);
            var    cookieConfig     = GetConfigCookieEntry(cookieStringName);

            if (cookieConfig.HasSubKey)
            {
                return(CookieHelper.GetCookie(cookieStringName, CookieNameHelper.GetSubName(cookieName)));
            }
            else
            {
                return(CookieHelper.GetCookie(cookieStringName));
            }
        }