CreateAppCookieStickinessPolicy
Generates a stickiness policy with sticky session lifetimes that follow that of an application-generated cookie. This policy can be associated only with HTTP/HTTPS listeners.
This policy is similar to the policy created by CreateLBCookieStickinessPolicy,
except that the lifetime of the special Elastic Load Balancing cookie, AWSELB
,
follows the lifetime of the application-generated cookie specified in the policy configuration.
The load balancer only inserts a new stickiness cookie when the application response
includes a new application cookie.
If the application cookie is explicitly removed or expires, the session stops being sticky until a new application cookie is issued.
For more information, see Application-controlled session stickiness in the User Guide for Classic Load Balancers.
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
- CookieName
-
The name of the application cookie used for stickiness.
Type: String
Required: Yes
- LoadBalancerName
-
The name of the load balancer.
Type: String
Required: Yes
- PolicyName
-
The name of the policy being created. Policy names must consist of alphanumeric characters and dashes (-). This name must be unique within the set of policies for this load balancer.
Type: String
Required: Yes
Errors
For information about the errors that are common to all actions, see Common Errors.
- DuplicatePolicyName
-
A policy with the specified name already exists for this load balancer.
HTTP Status Code: 400
- InvalidConfigurationRequest
-
The requested configuration change is not valid.
HTTP Status Code: 409
- LoadBalancerNotFound
-
The specified load balancer does not exist.
HTTP Status Code: 400
- TooManyPolicies
-
The quota for the number of policies for this load balancer has been reached.
HTTP Status Code: 400
Examples
Generate a stickiness policy
This example generates a stickiness policy that follows the sticky session lifetimes of the application-generated cookie.
Sample Request
https://elasticloadbalancing.amazonaws.com/?Action=CreateAppCookieStickinessPolicy
&LoadBalancerName=my-loadbalancer
&PolicyName=my-app-sticky-policy
&CookieName=my-app-cookie
&Version=2012-06-01
&AUTHPARAMS
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: