2020-05-22 16:38:34 +02:00
using System.ComponentModel ;
2025-11-09 03:50:24 +01:00
namespace ElectronNET.API.Entities
{
2020-05-22 16:38:34 +02:00
/// <summary>
///
/// </summary>
2025-11-22 02:16:10 +01:00
/// <remarks>Up-to-date with Electron API 39.2</remarks>
2025-11-09 03:50:24 +01:00
public class CookieDetails
{
2020-05-22 16:38:34 +02:00
/// <summary>
2025-11-22 02:16:10 +01:00
/// Gets or sets the URL to associate the cookie with. The operation will be rejected if the URL is invalid.
2020-05-22 16:38:34 +02:00
/// </summary>
public string Url { get ; set ; }
/// <summary>
2025-11-22 02:16:10 +01:00
/// Gets or sets the name of the cookie. Empty by default if omitted.
2020-05-22 16:38:34 +02:00
/// </summary>
[DefaultValue("")]
public string Name { get ; set ; }
/// <summary>
2025-11-22 02:16:10 +01:00
/// Gets or sets the value of the cookie. Empty by default if omitted.
2020-05-22 16:38:34 +02:00
/// </summary>
2025-11-09 03:50:24 +01:00
[DefaultValue("")]
2020-05-22 16:38:34 +02:00
public string Value { get ; set ; }
/// <summary>
2025-11-22 02:16:10 +01:00
/// Gets or sets the domain of the cookie; this will be normalized with a preceding dot so that it's also valid for subdomains. Empty by default if omitted.
2020-05-22 16:38:34 +02:00
/// </summary>
[DefaultValue("")]
public string Domain { get ; set ; }
/// <summary>
2025-11-22 02:16:10 +01:00
/// Gets or sets the path of the cookie. Empty by default if omitted.
2020-05-22 16:38:34 +02:00
/// </summary>
2025-11-09 03:50:24 +01:00
[DefaultValue("")]
2020-05-22 16:38:34 +02:00
public string Path { get ; set ; }
/// <summary>
2025-11-22 02:16:10 +01:00
/// Gets or sets a value indicating whether the cookie should be marked as secure. Defaults to false unless the SameSite policy is set to <c>no_restriction</c> (SameSite=None).
2020-05-22 16:38:34 +02:00
/// </summary>
2025-11-09 03:50:24 +01:00
[DefaultValue(false)]
2020-05-22 16:38:34 +02:00
public bool Secure { get ; set ; }
/// <summary>
2025-11-22 02:16:10 +01:00
/// Gets or sets a value indicating whether the cookie should be marked as HTTP only. Defaults to false.
2020-05-22 16:38:34 +02:00
/// </summary>
[DefaultValue(false)]
public bool HttpOnly { get ; set ; }
/// <summary>
2025-11-22 02:16:10 +01:00
/// Gets or sets the expiration date of the cookie as the number of seconds since the UNIX epoch. If omitted, the cookie becomes a session cookie and will not be retained between sessions.
2020-05-22 16:38:34 +02:00
/// </summary>
[DefaultValue(0)]
2025-11-22 02:16:10 +01:00
public double ExpirationDate { get ; set ; }
/// <summary>
/// Gets or sets the SameSite policy to apply to this cookie. Can be "unspecified", "no_restriction", "lax" or "strict". Default is "lax".
/// </summary>
public string SameSite { get ; set ; }
2020-05-22 16:38:34 +02:00
}
2025-11-09 03:50:24 +01:00
}