Pull cookie values without regular expressions



  • thiagofigueiro

    That's digital gold, Austin! cleans-up quite a bit of VCL code for anyone dealing with cookies.

    Did you measure how much extra processing this is costing your infrastructure? Any measurable added latency at all?

  • jasonkuhrt

    Supplying the cookie name via a table lookup doesn't seem to work though? Example: req.http.Cookie:table.lookup(relaunch, "cookieName") * fastly_service_v1.qa: [ERR] Invalid configuration for Fastly Service (5hYeq6hHppZbxco247CSKE): Syntax error: Expected ',' got '(' at: (input Line 253 Pos 35) req.http.Cookie:table.lookup(relaunch, "cookieName"), ----------------------------------#------------------------

  • bryanjswift

    Can this be used to unset only specific values. For example does unset req.http.Cookie:testHash remove the testHash value from the Cookie string?

  • Chris Hogan

    Late to the game, but yes that works. I didn't find it doc'd anywhere, but it worked when I tried it out.

Please sign in to leave a comment.