public CookieWrapper(HttpCookie cookie) { foreach (var pi in typeof(CookieWrapper).GetProperties()) { pi.SetValue(this, cookie.GetType().GetProperty(pi.Name).GetValue(cookie)); } }