In Rotating Proxy services, returning a different IP address with each request is the default behavior. However, in some use cases, you may need to use the same IP address for a specific period. The "sticky session" feature is used for this purpose.
Sticky session allows you to maintain the same IP address with a session key you define. This feature is critically important especially for session-based operations, form submissions, shopping cart management, or situations where platforms flag requests from different IPs as suspicious.
A session key is a unique identifier used to lock a specific IP address in the Rotating Proxy system. All requests made with the same session key originate from the same IP address throughout the session duration.
Use case scenarios:
In the LivaProxy system, the session key must comply with a specific format:
Format Rule: LVA + 7-character letter/number combination (10 characters total)
Valid examples:
There is no case sensitivity when creating session keys, but using the same format for consistency is recommended. Each unique session key assigns a different IP address, so you can use different session keys for different sessions.
You can activate the sticky session feature by adding the session parameter to your Rotating Proxy connection details:
Standard Rotating Proxy format:
username-country-tr-residential:[email protected]:10000
Usage with sticky session:
username-country-tr-session-LVA123AB45-residential:[email protected]:10000
In this example, the "session-LVA123AB45" parameter has been added. All requests made with the same session key will originate from the same IP address for a specific period.
You can work with multiple different IP addresses simultaneously by using different session keys:
Each session key assigns a different IP address, and these IPs remain fixed throughout the session duration.
The IP address assigned with sticky session remains fixed for a specific period. Session duration is automatically managed by the system and is typically activity-based.
IP renewal situations:
If you want to renew your IP address, simply change your session key. The new session key will automatically assign a new IP address.
Some proxy providers allow free format usage in the session parameter (e.g., session-myname123). In the LivaProxy system, the standard format starting with the "LVA" prefix is mandatory for security and system stability.
This format ensures:
Session key naming recommendations:
Performance optimization:
Using sticky session with Python:
import requests
session_key = "LVA123AB45"
proxy = {
"http": f"http://username-country-tr-session-{session_key}-residential:[email protected]:10000",
"https": f"http://username-country-tr-session-{session_key}-residential:[email protected]:10000"
}
response = requests.get("https://api.ipify.org", proxies=proxy)
print(f"My IP Address: {response.text}")
Testing with cURL:
curl -x rotating.livaproxy.com:10000 -U "username-country-tr-session-LVA123AB45-residential:password" https://api.ipify.org
"Session key format error" message:
Make sure your session key starts with "LVA" and is exactly 10 characters total.
IP address changes unexpectedly:
Verify that your session key is the same in every request. Ensure the session key is not dynamically generated in your code.
Do different session keys return the same IP?:
No, each unique session key assigns a different IP address. However, depending on the IP pool status, the same IP may rarely be assigned.
The sticky session feature in Rotating Proxy is a critical tool for scenarios where you need to maintain the same IP address. With LivaProxy, you can utilize this feature using the 10-character session key format starting with the "LVA" prefix. Regularly managing your session keys helps you achieve consistent performance and success rates in your projects.