Keep returning visitors pinned to the same origin using cookies.
Sticky sessions route repeat requests from the same visitor to the same origin. Use them when your application keeps per-user state on the origin server, such as login sessions or shopping carts that are not shared between backends.Sticky sessions are configured on the Load Balancer and are disabled by default. Sessions are tracked with a client cookie.
When cookie stickiness is enabled, the first response to a visitor sets an encrypted cookie named bunny_lb_{id} that records which origin served them. Subsequent requests carrying a valid cookie are routed to that origin, bypassing the balancing method.The cookie is a session cookie (it expires when the browser closes) and is set with HttpOnly and SameSite=Lax. The Secure flag is added when the request arrives over HTTPS. Its content is encrypted, so it cannot be read or forged by the client.
A sticky session is an optimization, never a guarantee. The visitor is re-balanced to a new origin (and receives a fresh cookie) whenever:
The pinned origin is unhealthy, disabled, or temporarily failing. Health always wins over stickiness.
The Load Balancer configuration changes. Edits to the Load Balancer, its groups, or its origins can invalidate active sessions.
The visitor’s IP address changes. Sessions are bound to the client’s network address, which limits cookie theft but means clients that switch networks are re-balanced.
Design your application to tolerate a visitor occasionally landing on a different origin, for example by using a shared session store.
Sticky sessions are automatically disabled on Pull Zones that have Request Coalescing enabled. Coalescing shares one origin fetch between many concurrent clients, which is incompatible with per-visitor origin pinning.
Stickiness only applies to requests that reach the origin. Cached responses are served from the edge regardless of the cookie.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"bunny.net Documentation","colors":{"primary":"#EF6126","light":"#EF6126","dark":"#EF6126"},"logo":{"light":"https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/logo/bunny-logo-dark.svg?fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=62c091ea1aaea93d0a981902b7783e37","dark":"https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/logo/bunny-logo-light.svg?fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=3610e32d68a9fa458b0116ac58ca812a"},"favicon":"https://mintcdn.com/bunnynet-cb9733c2/1bTPx1eyQm8EK8W3/favicon.png?fit=max\u0026auto=format\u0026n=1bTPx1eyQm8EK8W3\u0026q=85\u0026s=85267b63e804fac7a4dd94599bb8c6e8","navbar":{"links":[{"href":"https://bunny.net/docs/api-reference","label":"API Reference"},{"href":"https://github.com/BunnyWay","label":"GitHub"}],"primary":{"type":"button","label":"Get Started","href":"https://dash.bunny.net/auth/register"}},"footer":{"socials":{"discord":"https://discord.gg/bunnynet","github":"https://github.com/BunnyWay","x":"https://x.com/BunnyCDN","bluesky":"https://bsky.app/profile/bunny.net","linkedin":"https://www.linkedin.com/company/bunnynet","facebook":"https://www.facebook.com/bunnycdn"}},"icons":{"library":"lucide"},"contextual":{"options":["copy","claude","chatgpt","cursor","view","vscode"],"display":"header"},"interaction":{"drilldown":false},"metadata":{"timestamp":true},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"bunnynet-cb9733c2","hasAudioNarration":false,"actualSubdomain":"bunnynet-cb9733c2","customDomains":["bunny.net"],"gitSource":{"type":"github","owner":"bunnyway","repo":"documentation","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae49f2d21d44d6b52dcfe35","collectionId":"5e262b87-ade9-45d8-9b63-06888c8d59a3","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae49f2d21d44d6b52dcfe35"},"feedback":{"thumbs":true,"contextualFeedback":{"allowEmail":true},"agentFeedback":true,"edits":true,"issues":false},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae586f29229f31e96cc51a9","clientVersion":"0.0.4043","searchFilterCounts":[{"language":"default","tag":"Documentation","count":752},{"language":"default","tag":"API Reference","count":318},{"language":"default","tag":"Core Platform API","count":109},{"language":"default","tag":"CDN","count":82},{"language":"default","tag":"Shield API","count":66},{"language":"default","tag":"Stream","count":66},{"language":"default","tag":"Magic Containers API","count":56},{"language":"default","tag":"Storage","count":54},{"language":"default","tag":"Guides","count":54},{"language":"default","tag":"Reference","count":52}],"searchSettings":{"isFiltersEnabled":true}},"assistantConfig":{"enableStarterQuestions":false,"deflection":{"enabled":true,"type":"link","email":"support@bunny.net","url":"https://bunny.net/contact","showHelpButton":true}},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"privacy":{"consentBanner":{"enabled":true}},"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".dark img[src*=\"/logo/frameworks/angular.svg\"],.dark img[src*=\"/logo/frameworks/eleventy.svg\"],.dark img[src*=\"/logo/frameworks/express.svg\"],.dark img[src*=\"/logo/frameworks/mariadb.svg\"],.dark img[src*=\"/logo/frameworks/nextjs.svg\"],.dark img[src*=\"/logo/frameworks/sphinx.svg\"]{filter:invert(1)}html:not(.dark) img[src*=\"/logo/frameworks/zola.svg\"]{filter:invert(1)}"}],"page":{"pagePath":"cdn/load-balancer/sticky-sessions","slug":"/cdn/load-balancer/sticky-sessions","pageMetadata":{"title":"Sticky Sessions","description":"Keep returning visitors pinned to the same origin using cookies.","href":"/cdn/load-balancer/sticky-sessions"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Keep returning visitors pinned to the same origin using cookies.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,ul:`ul`,..._provideComponents(),...props.components},{Heading,Warning}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Sticky sessions route repeat requests from the same visitor to the same origin. Use them when your application keeps per-user state on the origin server, such as login sessions or shopping carts that are not shared between backends.`}),`\n`,_jsx(_components.p,{children:`Sticky sessions are configured on the Load Balancer and are disabled by default. Sessions are tracked with a client cookie.`}),`\n`,_jsx(Heading,{level:`2`,id:`how-it-works`,children:`How it works`}),`\n`,_jsxs(_components.p,{children:[`When cookie stickiness is enabled, the first response to a visitor sets an encrypted cookie named `,_jsx(_components.code,{children:`bunny_lb_{id}`}),` that records which origin served them. Subsequent requests carrying a valid cookie are routed to that origin, bypassing the balancing method.`]}),`\n`,_jsxs(_components.p,{children:[`The cookie is a session cookie (it expires when the browser closes) and is set with `,_jsx(_components.code,{children:`HttpOnly`}),` and `,_jsx(_components.code,{children:`SameSite=Lax`}),`. The `,_jsx(_components.code,{children:`Secure`}),` flag is added when the request arrives over HTTPS. Its content is encrypted, so it cannot be read or forged by the client.`]}),`\n`,_jsx(Heading,{level:`2`,id:`when-a-session-breaks`,children:`When a session breaks`}),`\n`,_jsx(_components.p,{children:`A sticky session is an optimization, never a guarantee. The visitor is re-balanced to a new origin (and receives a fresh cookie) whenever:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`The pinned origin is unhealthy, disabled, or temporarily failing. Health always wins over stickiness.`}),`\n`,_jsx(_components.li,{children:`The Load Balancer configuration changes. Edits to the Load Balancer, its groups, or its origins can invalidate active sessions.`}),`\n`,_jsx(_components.li,{children:`The visitor’s IP address changes. Sessions are bound to the client’s network address, which limits cookie theft but means clients that switch networks are re-balanced.`}),`\n`]}),`\n`,_jsx(_components.p,{children:`Design your application to tolerate a visitor occasionally landing on a different origin, for example by using a shared session store.`}),`\n`,_jsx(Heading,{level:`2`,id:`interactions`,children:`Interactions`}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Sticky sessions are automatically disabled on Pull Zones that have `,_jsx(_components.a,{href:`/cdn/request-coalescing`,children:`Request Coalescing`}),` enabled. Coalescing shares one origin fetch between many concurrent clients, which is incompatible with per-visitor origin pinning.`]})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Stickiness only applies to requests that reach the origin. Cached responses are served from the edge regardless of the cookie.`}),`\n`,_jsxs(_components.li,{children:[`The `,_jsx(_components.a,{href:`/cdn/load-balancer/routing#per-request-overrides-with-edge-rules`,children:`Force Sticky Session Mode Edge Rule`}),` can enable or disable stickiness for specific requests.`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Sticky Sessions","description":"Keep returning visitors pinned to the same origin using cookies.","href":"/cdn/load-balancer/sticky-sessions"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"How it works","slug":"how-it-works","depth":2,"children":[]},{"title":"When a session breaks","slug":"when-a-session-breaks","depth":2,"children":[]},{"title":"Interactions","slug":"interactions","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"bunnynet-cb9733c2","siteName":"bunny.net Documentation","title":"Sticky Sessions - bunny.net Documentation","relatedPagesConfig":{"enabled":false,"limit":5,"mode":"automatic"},"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-30T11:22:50.998Z","gitLastModified":"2026-09-30T11:22:19.000Z","originalFileLocation":"cdn/load-balancer/sticky-sessions.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Keep returning visitors pinned to the same origin using cookies.\">\u003cmeta data-mint-head name=\"application-name\" content=\"bunny.net Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Sticky Sessions - bunny.net Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Keep returning visitors pinned to the same origin using cookies.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"bunny.net Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://bunny.net/docs/cdn/load-balancer/sticky-sessions\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://bunnynet-cb9733c2.mintlify.app/_mintlify/api/og/v2?division=Load+Balancer\u0026amp;title=Sticky+Sessions\u0026amp;description=Keep+returning+visitors+pinned+to+the+same+origin+using+cookies.\u0026amp;theme=3e3fa11ba94222b95e7f52d5\u0026amp;signature=20d8f9f9f9d6f9c1387ec0eba1575012b66f9a936682a4cb25d0f24ff46a221f\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Sticky Sessions - bunny.net Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Keep returning visitors pinned to the same origin using cookies.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://bunnynet-cb9733c2.mintlify.app/_mintlify/api/og/v2?division=Load+Balancer\u0026amp;title=Sticky+Sessions\u0026amp;description=Keep+returning+visitors+pinned+to+the+same+origin+using+cookies.\u0026amp;theme=3e3fa11ba94222b95e7f52d5\u0026amp;signature=20d8f9f9f9d6f9c1387ec0eba1575012b66f9a936682a4cb25d0f24ff46a221f\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"bunny.net Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#EF6126\">\u003clink data-mint-head rel=\"canonical\" href=\"https://bunny.net/docs/cdn/load-balancer/sticky-sessions\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/cdn/load-balancer/sticky-sessions.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://bunny.net/#organization\",\"name\":\"bunny.net Documentation\",\"url\":\"https://bunny.net\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/logo/bunny-logo-dark.svg?fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=62c091ea1aaea93d0a981902b7783e37\"}},{\"@type\":\"WebSite\",\"@id\":\"https://bunny.net/docs#website\",\"name\":\"bunny.net Documentation\",\"url\":\"https://bunny.net/docs\",\"publisher\":{\"@id\":\"https://bunny.net/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://bunny.net/docs/cdn/load-balancer/sticky-sessions#webpage\",\"url\":\"https://bunny.net/docs/cdn/load-balancer/sticky-sessions\",\"name\":\"Sticky Sessions\",\"description\":\"Keep returning visitors pinned to the same origin using cookies.\",\"dateModified\":\"2026-09-30T11:22:19.000Z\",\"isPartOf\":{\"@id\":\"https://bunny.net/docs#website\"},\"breadcrumb\":{\"@id\":\"https://bunny.net/docs/cdn/load-balancer/sticky-sessions#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://bunny.net/docs/cdn/load-balancer/sticky-sessions#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Usage\",\"item\":\"https://bunny.net/docs/cdn/smart-cache\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Load Balancer\",\"item\":\"https://bunny.net/docs/cdn/load-balancer/index\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Sticky Sessions\",\"item\":\"https://bunny.net/docs/cdn/load-balancer/sticky-sessions\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://bunny.net/docs/cdn/load-balancer/sticky-sessions#article\",\"headline\":\"Sticky Sessions\",\"name\":\"Sticky Sessions\",\"description\":\"Keep returning visitors pinned to the same origin using cookies.\",\"url\":\"https://bunny.net/docs/cdn/load-balancer/sticky-sessions\",\"mainEntityOfPage\":{\"@id\":\"https://bunny.net/docs/cdn/load-balancer/sticky-sessions#webpage\"},\"dateModified\":\"2026-09-30T11:22:19.000Z\",\"publisher\":{\"@id\":\"https://bunny.net/#organization\"},\"isPartOf\":{\"@id\":\"https://bunny.net/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"bunny.net Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"bunny.net Documentation","nav":{"global":null,"products":[{"product":"Home","icon":"book-open","pages":[{"title":"Home","href":""}]},{"product":"CDN","icon":"zap","description":"Accelerate and protect your content globally","tabs":[{"tab":"Documentation","groups":[{"group":"Documentation","pages":[{"title":"Bunny CDN","sidebarTitle":"Introduction","mode":"wide","href":"/cdn"},{"title":"Quickstart","href":"/cdn/quickstart"},{"title":"Global Network Regions","sidebarTitle":"Regions","href":"/cdn/regions"},{"title":"Pricing","href":"/cdn/pricing"},{"title":"Bunny CDN Changelog","sidebarTitle":"Changelog","url":"/changelog?tags=CDN","href":"/cdn/changelog"},{"title":"CDN Limits and Defaults","sidebarTitle":"Limits","href":"/cdn/limits"},{"title":"Connectivity","sidebarTitle":"Connectivity","href":"/cdn/connectivity"},{"title":"IP Family Policy","sidebarTitle":"IP Family Policy","href":"/cdn/ip-family-policy"}]},{"group":"Usage","pages":[{"group":"Caching","pages":[{"title":"Smart Cache","href":"/cdn/smart-cache"},{"title":"Vary Cache","href":"/cdn/vary-cache"},{"title":"Query String Sort","href":"/cdn/query-string-sort"},{"title":"Perma-Cache","href":"/cdn/perma-cache"},{"title":"Request Coalescing","href":"/cdn/request-coalescing"},{"title":"Purge Cache","href":"/cdn/purge-cache"}]},{"group":"Edge Rules","pages":[{"title":"Edge Rules","sidebarTitle":"Overview","href":"/cdn/edge-rules/index"},{"title":"Trigger Path Setup","sidebarTitle":"Trigger Paths","href":"/cdn/edge-rules/trigger-path"},{"title":"Custom Cache Time for File Extensions","sidebarTitle":"Custom Cache Time","href":"/cdn/edge-rules/custom-cache-time"},{"title":"Redirect b-cdn.net to Custom Hostname","sidebarTitle":"Redirect Hostname","href":"/cdn/edge-rules/redirect-hostname"},{"title":"Direct IP Origin with Custom Hostname","sidebarTitle":"Direct IP Origin","href":"/cdn/edge-rules/ip-origin"},{"title":"Dynamic Variables","href":"/cdn/edge-rules/dynamic-variables"},{"title":"Variable Expansion","href":"/cdn/edge-rules/variable-expansion"},{"title":"Edge Rules Ordering","sidebarTitle":"Ordering \u0026 Execution","href":"/cdn/edge-rules/ordering"},{"title":"Pattern Matching in Edge Rules","href":"/cdn/edge-rules/pattern-matching"}]},{"group":"Load Balancer","pages":[{"title":"Load Balancer","sidebarTitle":"Overview","href":"/cdn/load-balancer/index"},{"title":"Origins and Origin Groups","href":"/cdn/load-balancer/origins"},{"title":"Routing Methods","description":"How the Load Balancer selects an origin group and an origin for each request.","href":"/cdn/load-balancer/routing"},{"title":"Sticky Sessions","href":"/cdn/load-balancer/sticky-sessions"},{"title":"Health and Failover","description":"How origin health is monitored and how the Load Balancer fails over when an origin becomes unavailable.","href":"/cdn/load-balancer/health-and-failover"},{"title":"Statistics","href":"/cdn/load-balancer/statistics"},{"title":"Load Balancer Pricing","sidebarTitle":"Pricing","href":"/cdn/load-balancer/pricing"}]},{"group":"Performance","pages":[{"title":"Performance","sidebarTitle":"Overview","href":"/cdn/performance/index"},{"title":"Origin Shield","href":"/cdn/performance/origin-shield"},{"title":"Smart Preloader","href":"/cdn/performance/smart-preloader"},{"title":"Routing Filters","href":"/cdn/performance/routing-filters"},{"title":"Network Limits","href":"/cdn/performance/network-limits"}]},{"group":"Security","pages":[{"title":"SSL","href":"/cdn/security/ssl"},{"title":"Hotlink Protection","href":"/cdn/security/hotlink-protection"},{"title":"Geographic Blocking","href":"/cdn/security/geographic-blocking"},{"group":"Token Authentication","pages":[{"title":"Token Authentication","sidebarTitle":"Overview","href":"/cdn/security/token-authentication/index"},{"title":"Basic Token Authentication","sidebarTitle":"Basic","href":"/cdn/security/token-authentication/basic"},{"title":"Advanced Token Authentication","sidebarTitle":"Advanced","href":"/cdn/security/token-authentication/advanced"}]},{"title":"JA4 Fingerprinting","href":"/cdn/security/ja4-fingerprinting"}]},{"group":"Logging","pages":[{"title":"Logging","sidebarTitle":"Overview","href":"/cdn/logging/index"},{"title":"Permanent Log Storage","href":"/cdn/logging/permanent-storage"},{"title":"Log Forwarding","href":"/cdn/logging/forwarding"},{"title":"Origin Errors","href":"/cdn/logging/origin-errors"}]}]},{"group":"Integrations","pages":[{"group":"CMS","pages":[{"title":"WordPress","url":"/integrations/wordpress","href":"/cdn/integrations/cms/wordpress"},{"title":"Typo3","href":"/cdn/integrations/cms/typo3"},{"title":"Joomla","href":"/cdn/integrations/cms/joomla"},{"title":"ExpressionEngine","href":"/cdn/integrations/cms/expressionengine"},{"title":"Shopware","href":"/cdn/integrations/cms/shopware"},{"title":"Drupal","href":"/cdn/integrations/cms/drupal"},{"title":"PrestaShop","href":"/cdn/integrations/cms/prestashop"},{"title":"Magento","href":"/cdn/integrations/cms/magento"},{"title":"Discourse","href":"/cdn/integrations/cms/discourse"}]},{"group":"Storage","pages":[{"title":"Microsoft Azure Storage Blobs","href":"/cdn/integrations/storage/azure-blob"},{"title":"Wasabi","href":"/cdn/integrations/storage/wasabi"},{"title":"Amazon S3","href":"/cdn/integrations/storage/amazon-s3"},{"title":"OVH Public Cloud","href":"/cdn/integrations/storage/ovh"},{"title":"Backblaze","href":"/cdn/integrations/storage/backblaze"},{"title":"DigitalOcean Spaces","href":"/cdn/integrations/storage/digitalocean-spaces"}]},{"group":"Frameworks","pages":[{"title":"Serve Astro from Bunny CDN with Bunny Optimizer","sidebarTitle":"Astro","href":"/cdn/integrations/frameworks/astro"},{"title":"Serve Next.js from Bunny CDN with Bunny Optimizer","sidebarTitle":"Next.js","href":"/cdn/integrations/frameworks/nextjs"}]}]},{"group":"Reference","pages":[{"title":"Request headers sent to your origin","sidebarTitle":"Request headers","href":"/cdn/request-headers-to-origin"},{"title":"Custom Hostname","href":"/cdn/custom-hostname"},{"title":"CDN Acceleration","href":"/cdn/cdn-acceleration"},{"title":"Verify your configuration","href":"/cdn/verify-configuration"},{"title":"SSL for Custom Domains","href":"/cdn/ssl-setup"},{"sidebarTitle":"Seamless Domain Migration","title":"How to Seamlessly Migrate Your Domain to bunny.net","href":"/cdn/seamless-migration"},{"title":"Custom 404 Page","href":"/cdn/custom-404-page"},{"title":"WebSockets","href":"/cdn/websockets"},{"title":"Server-Sent Events (SSE)","sidebarTitle":"Server-Sent Events","href":"/cdn/server-sent-events"},{"group":"Frequently Asked Questions","pages":[{"title":"Do you support ETag?","href":"/cdn/frequently-asked-questions/etag-support"},{"title":"Do you support cache warming or preloading content onto the CDN?","href":"/cdn/frequently-asked-questions/cache-warming"},{"title":"Does BunnyCDN automatically detect when a file is changed?","href":"/cdn/frequently-asked-questions/updating-files"},{"title":"Do you support range requests?","href":"/cdn/frequently-asked-questions/range-requests"},{"title":"Do you support RTMP streaming?","href":"/cdn/frequently-asked-questions/rtmp-streaming"},{"title":"Is there a domain limit on pull zone configurations?","href":"/cdn/frequently-asked-questions/domain-limit"},{"title":"MIME Type Compression Support","href":"/cdn/frequently-asked-questions/mime-compression"},{"title":"Which PoP you are being routed to","href":"/cdn/frequently-asked-questions/pop-routing"}]},{"group":"Troubleshooting","pages":[{"title":"Find Your PoP and Run Diagnostics","href":"/cdn/troubleshooting/run-traceroute"},{"title":"Generate a HAR File","href":"/cdn/troubleshooting/generate-a-har-file"},{"title":"Website Still Slow","href":"/cdn/troubleshooting/still-slow"}]}]}]}]},{"product":"Magic Containers","icon":"box","description":"Deploy any app anywhere with Docker","pages":[{"title":"Magic Containers","href":"/magic-containers"}]},{"product":"Edge Scripting","icon":"code","description":"Deploy serverless code at the edge","pages":[{"title":"Edge Scripting","href":"/scripting"}]},{"product":"Stream","icon":"video","description":"Video streaming and delivery platform","pages":[{"title":"Stream","href":"/stream"}]},{"product":"Storage","icon":"hard-drive","description":"Global object storage","pages":[{"title":"Storage","href":"/storage"}]},{"product":"Shield","icon":"shield","description":"Stay protected and online no matter what","pages":[{"title":"Shield","href":"/shield"}]},{"product":"Optimizer","icon":"sparkles","description":"Automatic image and web optimization.","pages":[{"title":"Optimizer","href":"/optimizer"}]},{"product":"DNS","icon":"globe","description":"Unlock the true power of DNS with an ultra-fast scriptable platform","pages":[{"title":"DNS","href":"/dns"}]},{"product":"Database","icon":"database","description":"Serverless SQLite over HTTP","pages":[{"title":"Database","href":"/database"}]},{"product":"Integrations","icon":"puzzle","description":"Official and third-party plugins and integrations","pages":[{"title":"Integrations","href":"/integrations/wordpress"}]},{"product":"CLI","icon":"terminal","description":"Manage bunny.net from your terminal","pages":[{"title":"CLI","href":"/cli"}]},{"product":"API Reference","icon":"square-terminal","description":"Build \u0026 Integrate with the Platform API","pages":[{"title":"API Reference","href":"/api-reference"}]},{"product":"Partners","icon":"handshake","description":"Manage customers, pricing, and billing as a bunny.net partner","pages":[{"title":"Partners","href":"/partners"}]}]},"basePath":"","title":"Sticky Sessions - bunny.net Documentation","buildId":"dpl_4RHMRqtvdHvKgaEfTTjFqjzja3B6","deploymentId":"dpl_4RHMRqtvdHvKgaEfTTjFqjzja3B6","dynamics":[],"chunks":[]}