← Back to Blog 0.7.0 · APPS · BROWSER

Cookie Path Match — RFC 6265 Path Matching

June 23, 2026 · Sigil-Docs · sigil-apps 4760f51
appsbrowsernet0.7.0

cookie_path_match.sg is the T18 sprint — RFC 6265 cookie-path matching. req_path matches cookie_path if req_path starts with cookie_path AND (cookie_path ends with / OR req_path[len(cookie_path)] == '/'). Tests: 3 cookies (/, /app, /api) against 3 requests (/app/users, /api/v1, /other), 6 match results. COOKIE-PATH-PASS 6/6. 10224 B arm-el0.

RFC 6265 path matcher

cookie_path_match()
path_match() prefix + boundary checkpath_match(req_path, cookie_path): returns 1 if req_path matches cookie_path per RFC 6265 §5.1.4. Algorithm: (1) check req_path starts with cookie_path (byte-for-byte prefix compare); (2) if cookie_path ends with /, match (root path always matches all sub-paths); (3) otherwise check req_path[len(cookie_path)] == '/' (path boundary — prevents /app matching /application). Test matrix: cookie / matches all 3 requests; cookie /app matches /app/users but not /api/v1 or /other; cookie /api matches /api/v1 but not /app/users or /other. COOKIE-PATH-PASS 6/6.