A load-balancer assigns incoming requests to servers at a
server farm. An atomic operation assigns both un-encrypted clear-text requests and encrypted requests from a
client to the same
server at the
server farm. An encrypted session is started early by the atomic operation, before
encryption is required. The atomic operation is initiated by a special, automatically loaded component on a
web page. This component is referenced by code requiring that an encrypted session be used to retrieve the component. Keys and certificates are exchanged between a server and the
client to establish the encrypted session. The server generates a secure-sockets-layer (SSL)
session ID for the encrypted session. The server also generates a server-assignment cookie that identifies the server at the
server farm. The server-assignment cookie is encrypted and sent to the
client along with the SSL
session ID. The
Client decrypts the server-assignment cookie and stores it along with the SSL
session ID. The load-balancer stores the SSL session ID along with a server assignment that identifies the server that generated the SSL session ID. When other encrypted requests are generated by the client to the
server farm, they include the SSL session ID. The load-balancer uses the SSL session ID to send the requests to the assigned server. When the client sends a non-encrypted clear-text request to the
server farm, it includes the decrypted server-assignment cookie. The load balancer parses the clear-text request to find the server-assignment cookie. The load-balancer then sends the request to the assigned server.