File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -139,8 +139,8 @@ const setUiCookie = (res, service) => {
139139 if ( ! res ?. setHeader || ! service ) return ;
140140 // Normalize service name: decode URL encoding, lowercase, replace spaces and forward slashes with underscores
141141 const normalized = decodeURIComponent ( service ) . toLowerCase ( ) . replace ( / \s + / g, '_' ) . replace ( / \/ / g, '_' ) ;
142- // Use Path=/ui/ to restrict cookie to UI routes only, preventing interference with other pages
143- const cookieValue = `${ UI_SERVICE_COOKIE } =${ normalized } ; Path=/ui/ ; SameSite=Lax` ;
142+ // Use Path=/ so cookie is sent with all requests (needed for ARR API routing and subrequests)
143+ const cookieValue = `${ UI_SERVICE_COOKIE } =${ normalized } ; Path=/; SameSite=Lax` ;
144144 const existing = res . getHeader ( 'set-cookie' ) ;
145145 if ( ! existing ) {
146146 res . setHeader ( 'set-cookie' , cookieValue ) ;
@@ -450,7 +450,7 @@ export default defineEventHandler(async (event) => {
450450
451451 // Determine which service to use for API routing
452452 // Priority: cookie > cached service from session
453- // Note: Cookie won't be sent for /api paths (Path=/ui/), so we rely on session cache
453+ // Both should be available, cookie is preferred as it's more reliable
454454 const apiRoutingService = cookieService || cachedService ;
455455 const apiRoutingServiceType = cookieService ? cookieServiceType : cachedServiceType ;
456456
You can’t perform that action at this time.
0 commit comments