# YarpSessionAffinityCookieConfig

- Module: [Aspire.Hosting.Yarp](/reference/api/go/aspire.hosting.yarp.md)
- Version: `17.0.0`
- Kind: `struct`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/2d325b13709752ba6d9a943635c5e2940a2530c0)

Represents session affinity cookie configuration for a YARP cluster.

## Definition

```go
type YarpSessionAffinityCookieConfig struct {
    Domain       *string             `json:"Domain"`
    Expiration   *float64            `json:"Expiration"`
    HttpOnly     *bool               `json:"HttpOnly"`
    IsEssential  *bool               `json:"IsEssential"`
    MaxAge       *float64            `json:"MaxAge"`
    Path         *string             `json:"Path"`
    SameSite     *SameSiteMode       `json:"SameSite"`
    SecurePolicy *CookieSecurePolicy `json:"SecurePolicy"`
}
```

## Fields

- `Domain`: `*string` -- Gets or sets the cookie domain.
- `Expiration`: `*float64` `optional` -- Gets or sets the cookie expiration.
- `HttpOnly`: `*bool` `optional` -- Gets or sets a value indicating whether the cookie is HTTP only.
- `IsEssential`: `*bool` `optional` -- Gets or sets a value indicating whether the cookie is essential.
- `MaxAge`: `*float64` `optional` -- Gets or sets the cookie max age.
- `Path`: `*string` -- Gets or sets the cookie path.
- `SameSite`: `*SameSiteMode` `optional` -- Gets or sets the same-site mode.
- `SecurePolicy`: `*CookieSecurePolicy` `optional` -- Gets or sets the secure policy.
