コード例 #1
0
 /// <summary>
 /// Creates a new cookie provider with the given handler and options.
 /// </summary>
 /// <param name="handler">The handler responsible for file system interaction.</param>
 /// <param name="options">The options to use for the cookie provider.</param>
 public AdvancedCookieProvider(ICookieFileHandler handler, AdvancedCookieProviderOptions options = default)
 {
     _handler           = handler;
     _forceParse        = options.IsForceParse;
     _httpOnlyExtension = options.IsHttpOnlyExtension;
     _cookies           = ReadCookies();
 }
コード例 #2
0
 /// <summary>
 /// Registers the advanced cookie service.
 /// </summary>
 /// <param name="configuration">The configuration to extend.</param>
 /// <param name="fileHandler">The handler for the cookie source.</param>
 /// <returns>The new instance with the service.</returns>
 public static IConfiguration WithCookies(this IConfiguration configuration, ICookieFileHandler fileHandler) =>
 configuration.WithCookies(new AdvancedCookieProvider(fileHandler));