Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="days"></param>
        public void Save(int days = 0)
        {
            var cookie = new HttpCookie(KEY);

            cookie.Values.Add("ID", UserId.TryParseToString());
            cookie.Values.Add("Name", DisplayName.UrlEncode());
            cookie.Values.Add("IsRemeberUserName", IsRemeberUserName.TryParseToString());

            cookie.HttpOnly = true;


            cookie.Expires = DateTime.Now.AddMinutes(10);

            if (this.Expires > DateTime.Now)
            {
                cookie.Expires = this.Expires;
            }


            Context.Response.AppendCookie(cookie);
        }