Session Lock
Session Lock
Section titled “Session Lock”Session Lock ensures your agent uses the same exit IP address throughout an entire task, maintaining session continuity with target websites.
Why It Matters
Section titled “Why It Matters”Many websites track sessions by IP. If your IP changes mid-task:
- Shopping carts get cleared
- Login sessions expire
- Multi-page scraping gets flagged as suspicious
- Account operations trigger security alerts
How It Works
Section titled “How It Works”proxy = client.get_proxy( target="amazon.com", session_lock=True # ← enables session lock)
# All requests through this proxy use the same IPfor page in range(1, 50): requests.get(f"https://amazon.com/s?page={page}", proxies=proxy.to_dict()) # Same IP every time ↑When you enable session_lock=True:
- HydraSkill assigns a dedicated IP from the pool
- That IP is reserved exclusively for your session
- No other user can get that IP while your session is active
- The IP persists until you call
proxy.release()or the session times out
Session Timeout
Section titled “Session Timeout”Sessions auto-expire after 30 minutes of inactivity (no requests). You can configure this:
proxy = client.get_proxy( target="amazon.com", session_lock=True, session_ttl=3600 # 1 hour timeout)Session Lock + Auto-Heal
Section titled “Session Lock + Auto-Heal”When Session Lock is combined with Auto-Heal, if your locked IP gets blocked:
- HydraSkill detects the block (403, CAPTCHA, connection reset)
- Automatically assigns a new IP from the same region
- Updates the session binding transparently
- Your next request goes through the new IP — no code changes needed
The session continues uninterrupted. Your agent never sees the failure.
Best Practices
Section titled “Best Practices”- Enable Session Lock for multi-page tasks (pagination, checkout flows)
- Disable it for one-shot requests where IP consistency doesn’t matter
- Set appropriate
session_ttlto avoid holding IPs unnecessarily - Call
proxy.release()when done to free the IP back to the pool