What is Session?
In proxy usage, a session is a span of requests that all exit through the same IP address. It begins when you open a connection or claim a session identifier, and it ends when that identifier's timer expires or the network reassigns the address underneath you. Session control is what separates rotating traffic from a continuous identity.
Most gateway providers expose sessions through the username field rather than a separate API. You send credentials shaped like user-country-us-session-a91f3, and the gateway maps that string to a slot in its routing table, handing every request carrying the same string to the same exit node. Change one character and you get a different address. Other providers assign a port per session, so port 10001 is one identity and 10002 is another. Both designs put the choice in the client configuration, which means any HTTP library that supports proxy authentication can drive it without extra code.
A session runs on two clocks. The provider's time-to-live decides how long the mapping between your identifier and the exit IP stays valid, commonly a few minutes on residential gateways and longer where you control the device. The underlying network keeps its own clock. A mobile address can change when the carrier's DHCP lease renews, when the modem reconnects, or when a tower hands the device to another gateway. Your session survives only while both clocks agree, so treat the duration you asked for as an upper bound.
Do not confuse the network session with the application session. A logged-in account is held by cookies and tokens; the proxy session only keeps the IP steady underneath all of that. Pairing them badly is the usual cause of surprise logouts. The cookie jar persists while the exit address jumps mid-checkout, and the site's risk engine sees one account arriving from two networks seconds apart. Bind one cookie store, one browser fingerprint and one exit IP together for the life of an identity.
Verify rather than assume. Call an IP echo endpoint at the start and end of a run through the same proxy string and compare the answers. If they differ, the session expired or the provider rotated you without saying so. Logging the exit address alongside every request costs almost nothing and turns a vague complaint about blocks into a timestamped moment where the address changed. For long jobs, checkpoint your state so a lost session resumes on a fresh IP instead of restarting the crawl.
Where you meet it
You meet sessions the first time a scraper works fine on read-only pages and falls apart the moment it has to log in. The answer is holding one address steady rather than adding more of them. In practice you pick a session length per task, seconds for search result pages and tens of minutes for account work, then encode that choice in the proxy username or the port you dial. Getting it wrong shows up as random 403s and repeated re-authentication prompts.
Common questions
How long does a proxy session last?
It depends on the provider and the network underneath. Residential gateways commonly cap sessions somewhere between a minute and half an hour, while mobile lines where you control rotation can hold an address for hours. Whatever the published maximum says, the carrier or the device can end a session earlier, so build for an early end.
What is the difference between a session and a sticky session?
A session is the general idea of requests sharing one exit IP. A sticky session is the specific feature you switch on to keep that address for a stated duration. Rotating configurations use sessions too; theirs last a single request before the gateway picks a new address for the next one.
Why did my exit IP change in the middle of a session?
Either the provider's session timer ran out and the gateway reassigned you, or the underlying line changed address through a DHCP lease renewal, a modem reconnect, or a tower handoff on mobile. Logging the exit IP with each request tells you which, since a timer expiry lands on a predictable boundary.
Related terms
Real 4G/5G mobile and residential IPs
PROXIES.SX runs carrier IPs in 100+ countries with HTTP and SOCKS5 on every endpoint. $4/GB down to $2.40/GB at volume, free endpoints and rotation, and your GB never expire.