Updating session stickiness for application load balancers
You can update the session stickiness for an IBM Cloud® Application Load Balancer for VPC (ALB) with the console, CLI, or API.
Updating session stickiness for application load balancers using the UI
To update session stickiness for an ALB by in the IBM Cloud console, perform the following procedure:
-
From your browser, open the IBM Cloud console and log in to your account.
-
Select the Navigation menu
, then click Infrastructure
> Network > Load balancers.
-
Select the Region of your load balancer.
-
Select the load balancer that you want to update.
-
Select Back-end pool where you need to edit the session stickiness.
-
After you're done editing, select Save to save your changes.
The Active button in the upper left of your window should now show as Updating. When the Updating status changes back to Active, the update is done and the new changes are applied.
Updating session stickiness for application load balancers using the CLI
To use the CLI to update session stickiness for your application load balancer, follow these steps:
-
Set up your CLI environment.
-
Log in to your account using the CLI. After you enter the password, the system prompts which account and region that you want to use:
ibmcloud login --sso -
Update your ALB's session stickiness:
ibmcloud is load-balancer-pool-update 72251a2e-d6c5-42b4-97b0-b5f8e8d1f479 72b27b5c-f4b0-48bb-b954-5becc7c1dcb3 --session-persistence-type app_cookie --session-persistence-cookie-name my-cookie-name where: 72251a2e-d6c5-42b4-97b0-b5f8e8d1f479 = Load Balancer ID 72b27b5c-f4b0-48bb-b954-5becc7c1dcb3 = VPC ID session-persistence-type = app_cookie session-persistence-cookie-name = my-cookie-name
There are multiple ways to update your ALB from the CLI. For other options, see VPC CLI reference for load balancers.
Updating session stickiness for application load balancers using the API
The following example illustrates how to use the API to update session stickiness for an application load balancer.
To update session stickiness for an application load balancer with the API, perform the following procedure:
-
Set up your API environment.
-
Store the following values in variables to be used in the API command:
-
loadBalancerId- First, get your load balancer and then populate the variable:export ResourceGroupId=<your_resourcegroup_id>
-
-
Alternatively, you can find your resource group ID by using IBM Cloud console. From your browser, open the IBM Cloud console and log in to your account. Select Manage > Account > Resource Groups.
-
Use the following example to update session stickiness for your application load balancer:
curl -X PATCH "$vpc_api_endpoint/v1/load_balancers/$load_balancer_id/pools/$pool_id?version=2025-11-18&generation=2" -H "Authorization: Bearer $iam_token" \ -d '{ "name": "my-pool", "session_persistence": { "type": "source_ip" } }'There are multiple ways to update your ALB from the API. For other options, see VPC API reference for load balancers.