# Network Services V1 API - Class Google::Cloud::NetworkServices::V1::GrpcRoute::StatefulSessionAffinityPolicy (v2.10.1)

2.10.1 (latest) 2.10.0 2.9.0 2.8.0 2.7.0 2.6.1 2.5.0 2.4.0 2.3.0 2.2.0 2.1.0 2.0.1 1.2.0 1.1.0 1.0.1 0.2.0 0.1.0 Reference documentation and code samples for the Network Services V1 API class Google::Cloud::NetworkServices::V1::GrpcRoute::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.


<br />

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.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #cookie_ttl

    def cookie_ttl() -> ::Google::Protobuf::Duration

**Returns**

- ([::Google::Protobuf::Duration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_services-v1/latest/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.

### #cookie_ttl=

    def cookie_ttl=(value) -> ::Google::Protobuf::Duration

**Parameter**

- **value** ([::Google::Protobuf::Duration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_services-v1/latest/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.
**Returns**

- ([::Google::Protobuf::Duration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_services-v1/latest/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.