# Google Cloud Network Services V1 Client - Class StatefulSessionAffinityPolicy (0.8.2)

0.8.2 (latest) 0.8.1 0.7.1 0.6.1 0.5.0 0.4.0 0.3.0 0.2.3 0.1.1 Reference documentation and code samples for the Google Cloud Network Services V1 Client class StatefulSessionAffinityPolicy.

The specification for cookie-based stateful session affinity where the
date plane supplies a "session cookie" with the name "GSSA" which encodes
a specific destination host and each request containing that cookie will
be directed to that host as long as the destination host remains up and
healthy.

The gRPC proxyless mesh library or sidecar proxy will manage the session
cookie but the client application code is responsible for copying the
cookie from each RPC in the session to the next.

Generated from protobuf message `google.cloud.networkservices.v1.HttpRoute.StatefulSessionAffinityPolicy`

## Namespace

Google \\ Cloud \\ NetworkServices \\ V1 \\ HttpRoute

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ cookie_ttl` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Required. The cookie TTL value for the Set-Cookie header generated by the data plane. The lifetime of the cookie may be set to a value from 0 to 86400 seconds (24 hours) inclusive. Set this to 0s to use a session cookie and disable cookie expiration. |

### getCookieTtl

Required. The cookie TTL value for the Set-Cookie header generated by
the data plane. The lifetime of the cookie may be set to a value from 0
to 86400 seconds (24 hours) inclusive.

Set this to 0s to use a session cookie and disable cookie expiration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration|null` |   |

### hasCookieTtl

### clearCookieTtl

### setCookieTtl

Required. The cookie TTL value for the Set-Cookie header generated by
the data plane. The lifetime of the cookie may be set to a value from 0
to 86400 seconds (24 hours) inclusive.

Set this to 0s to use a session cookie and disable cookie expiration.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |