/// <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); }
private static ConfigCookieEntry GetConfigCookieEntry(string cookieName) { ConfigCookieEntry entity = ConfigHelper.CookieConfig.GetConfigCookieEntry(cookieName); if (entity == null) { entity = new ConfigCookieEntry(); } return(entity); }
/// <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); } }
private static ConfigCookieEntry GetConfigCookieEntry(string cookieName) { ConfigCookieEntry entity = ConfigHelper.CookieConfig.GetConfigCookieEntry(cookieName); if (entity == null) { entity = new ConfigCookieEntry(); } return entity; }