예제 #1
0
        private static void AccountCookieSet(AccountInfo account)
        {
            HttpCookie cookie = AccountCookieGet();
            cookie.Value = GetCryptographyString(string.Format("{0}|{1}|{2}|{3}", Context.Request.UserHostName, account.UserName, account.Id, DateTime.Now.Ticks));

            CacheCommand<AccountInfo> cache = new CacheCommand<AccountInfo>(cookie.Value);
            cache.Set(account, cookie.Expires);

            if (Context.Request.Cookies.Get(cookie.Name) == null)
            {
                Context.Response.Cookies.Add(cookie);
            }
            else
            {
                Context.Response.Cookies.Set(cookie);
            }
        }