Beispiel #1
0
        public static void SetConnectionString(string Conn)
        {
            HttpCookie aCookie = new HttpCookie("DCS");

            aCookie.Value    = AESStringCrypto.Encrypt(Conn, passPhrase);
            aCookie.Expires  = DateTime.Now.AddYears(1);
            aCookie.Domain   = "localhost";
            aCookie.Secure   = true;
            aCookie.HttpOnly = false;
            System.Web.HttpContext.Current.Response.Cookies.Add(aCookie);
        }
Beispiel #2
0
        public static void SetUserPreferences(int SId, int DId)
        {
            HttpCookie aCookie = new HttpCookie("UserPref");

            aCookie.Values["SId"] = AESStringCrypto.Encrypt(SId.ToString(), passPhrase);
            aCookie.Values["DId"] = AESStringCrypto.Encrypt(DId.ToString(), passPhrase);
            aCookie.Expires       = DateTime.Now.AddYears(1);
            aCookie.Domain        = "localhost";
            aCookie.Secure        = true;
            aCookie.HttpOnly      = false;
            System.Web.HttpContext.Current.Response.Cookies.Add(aCookie);
        }