client.identity

STRING, can be read and set, but not unset.

Available in all subroutines.

This variable is used by the Client director to determine which backend to pick. Given the same client.identity, the same backend will be chosen every time. Defaults to the client IP address.

Try it out

client.identity is used in the following solution recipes, which show real world use cases. Click RUN to provision a Fastly service, execute the code on Fastly, and see how the function behaves.

Client director

Map requests to backends based on user ID (a.k.a., "sticky sessions"). Defaults to IP address but you can customize.

User contributed notes

We welcome comments that add use cases, ideas, tips, and caveats. All comments will be moderated before publication. To post support questions, visit our support center and we'll find you the help you need.