protected virtual bool SaveToSession(IPlatSessionData session) { string value = session.ToPlatString((int)EnumPlatSessionMode.Session); if (string.IsNullOrEmpty(value)) { return(false); } HttpContext.Current.Session[PlatCookieName] = value; return(true); }
protected virtual bool SaveToCookie(IPlatSessionData session) { string value = session.ToPlatString((int)EnumPlatSessionMode.Cookie); if (string.IsNullOrEmpty(value)) { return(false); } var cookie = new HttpCookie(PlatCookieName); cookie.Value = CryptoUtil.ToBase64(value); cookie.Expires = DateTime.Now.AddMinutes(PlatExpireInMinutes); if (!string.IsNullOrEmpty(_shareDomain)) { cookie.Domain = _shareDomain; } HttpContext.Current.Response.Cookies.Set(cookie); return(true); }