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.
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
defcookie_ttl()->::Google::Protobuf::Duration
Returns
(::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.
value (::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) — 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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Network Services V1 API - Class Google::Cloud::NetworkServices::V1::GrpcRoute::StatefulSessionAffinityPolicy (v2.4.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.4.0 (latest)](/ruby/docs/reference/google-cloud-network_services-v1/latest/Google-Cloud-NetworkServices-V1-GrpcRoute-StatefulSessionAffinityPolicy)\n- [2.3.0](/ruby/docs/reference/google-cloud-network_services-v1/2.3.0/Google-Cloud-NetworkServices-V1-GrpcRoute-StatefulSessionAffinityPolicy)\n- [2.2.0](/ruby/docs/reference/google-cloud-network_services-v1/2.2.0/Google-Cloud-NetworkServices-V1-GrpcRoute-StatefulSessionAffinityPolicy)\n- [2.1.0](/ruby/docs/reference/google-cloud-network_services-v1/2.1.0/Google-Cloud-NetworkServices-V1-GrpcRoute-StatefulSessionAffinityPolicy)\n- [2.0.1](/ruby/docs/reference/google-cloud-network_services-v1/2.0.1/Google-Cloud-NetworkServices-V1-GrpcRoute-StatefulSessionAffinityPolicy)\n- [1.2.0](/ruby/docs/reference/google-cloud-network_services-v1/1.2.0/Google-Cloud-NetworkServices-V1-GrpcRoute-StatefulSessionAffinityPolicy)\n- [1.1.0](/ruby/docs/reference/google-cloud-network_services-v1/1.1.0/Google-Cloud-NetworkServices-V1-GrpcRoute-StatefulSessionAffinityPolicy)\n- [1.0.1](/ruby/docs/reference/google-cloud-network_services-v1/1.0.1/Google-Cloud-NetworkServices-V1-GrpcRoute-StatefulSessionAffinityPolicy)\n- [0.2.0](/ruby/docs/reference/google-cloud-network_services-v1/0.2.0/Google-Cloud-NetworkServices-V1-GrpcRoute-StatefulSessionAffinityPolicy)\n- [0.1.0](/ruby/docs/reference/google-cloud-network_services-v1/0.1.0/Google-Cloud-NetworkServices-V1-GrpcRoute-StatefulSessionAffinityPolicy) \nReference documentation and code samples for the Network Services V1 API class Google::Cloud::NetworkServices::V1::GrpcRoute::StatefulSessionAffinityPolicy.\n\nThe specification for cookie-based stateful session affinity where the\ndate plane supplies a \"session cookie\" with the name \"GSSA\" which encodes\na specific destination host and each request containing that cookie will\nbe directed to that host as long as the destination host remains up and\nhealthy.\n\n\n\u003cbr /\u003e\n\nThe gRPC proxyless mesh library or sidecar proxy will manage the session\ncookie but the client application code is responsible for copying the\ncookie from each RPC in the session to the next. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #cookie_ttl\n\n def cookie_ttl() -\u003e ::Google::Protobuf::Duration\n\n**Returns**\n\n- ([::Google::Protobuf::Duration](./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.\n\n\n Set this to 0s to use a session cookie and disable cookie expiration.\n\n### #cookie_ttl=\n\n def cookie_ttl=(value) -\u003e ::Google::Protobuf::Duration\n\n**Parameter**\n\n- **value** ([::Google::Protobuf::Duration](./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.\n\n\nSet this to 0s to use a session cookie and disable cookie expiration. \n**Returns**\n\n- ([::Google::Protobuf::Duration](./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.\n\n\n Set this to 0s to use a session cookie and disable cookie expiration."]]