Sticky Sessions
Sticky sessions refer to using the same IP address for all requests across a session (e.g., from browser start to browser close).
Sticky sessions are enabled if your connection has a session ID. Sticky sessions are disabled if your connection has no session ID.
When sticky sessions are enabled, all requests with the same session ID are routed to the same IP address. By using the same session ID for all requests in a session (e.g., loading a specific website), you'll use the same IP address for that session.
When sticky sessions are disabled, each request you send over Aluvia is routed to a different IP address. For example, if your AI agent loads a website without sticky sessions enabled, each of the requests it sends to load page content will have a different IP address.
Benefits
- Session Consistency: Maintains the same IP address throughout the user's session
- Reduced Authentication Issues: Prevents websites from flagging multiple IP changes as suspicious activity
- Better Performance: Eliminates the overhead of establishing new connections for each request
- Compatibility: Works better with websites that implement strict session tracking
Default behavior
By default, new connections have a randomly generated session ID, meaning that sticky sessions are enabled by default for each new connection you create.
Sticky session duration
When using sticky sessions, requests using the same session ID will be routed to the same IP address for as long as it is available. If an IP address is no longer available, requests will be routed to a new IP address from the pool of available mobile IP addresses.
Because mobile IP addresses are assigned by mobile carriers, we cannot explicitly control how long your new IP address will be available. You should generally expect the max availability time of a mobile IP address to be about 10 minutes.
How to enable or disable sticky sessions using the Aluvia client
You can enable/disable sticky sessions by adding/removing a connection's session ID.
// setting a session ID enables sticky sessions
await client.updateSessionId('session1');
See Manage Connections for examples.
How to enable or disable sticky sessions using the -session parameter
In instances where you cannot use the SDK or API (e.g., using a third-party proxy client), you can enable/disable sticky sessions by adding/removing the -session parameter and a session ID to your connection's username.
myusername-session-abc123
Examples
Sticky sessions disabled
Each request will use a different IP address.
Username: myusername
Request 1 IP: 1.1.1.1
Request 2 IP: 2.2.2.2
Request 3 IP: 3.3.3.3
Sticky sessions enabled
Each request with the same session ID will use the same IP address.
Session 1:
Username: myusername-session-abc123
Request 1 IP: 1.1.1.1
Request 2 IP: 1.1.1.1
Request 3 IP: 1.1.1.1
Session 2:
Username: myusername-session-def456
Request 1 IP: 2.2.2.2
Request 2 IP: 2.2.2.2
Request 3 IP: 2.2.2.2
Session 3:
Username: myusername-session-ghi789
Request 1 IP: 3.3.3.3
Request 2 IP: 3.3.3.3
Request 3 IP: 3.3.3.3