Beispiel #1
0
        private static void SetCookie(HttpCookie cookie, bool isEncrypt)
        {
            cookie.Value    = isEncrypt ? TranslateUtils.EncryptStringBySecretKey(cookie.Value) : cookie.Value;
            cookie.HttpOnly = false;

            if (HttpContext.Current.Request.Url.Scheme.Equals("https"))
            {
                cookie.Secure = true;//通过https传递cookie
            }
            HttpContext.Current.Response.Cookies.Add(cookie);
        }
Beispiel #2
0
 public static string GetLoadingUrl(string url)
 {
     return(GetAdminUrl($"loading.aspx?redirectUrl={TranslateUtils.EncryptStringBySecretKey(url)}"));
 }