Exemple #1
0
        public static void SetCookie(string name, string value, string path = "/", int validDaysSinceNow = 1)
        {
            var x = new Bridge.Html5.Date();

            x.SetDate(x.GetDate() + validDaysSinceNow);
            var expires = x.ToUTCString();

            Document.Cookie = $"{name}={value};path={path};expires=" + expires;
        }
Exemple #2
0
        public static void RemoveCookie(string name, string path = "/")
        {
            var expires = new Bridge.Html5.Date(1970, 1, 1).ToUTCString();

            Document.Cookie = $"{name}=;path={path};Max-Age=-9999;expires={expires};";
        }