Pull cookie values without regular expressions

Comments

4 comments

  • 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?

    0
    Comment actions Permalink
  • 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"), ----------------------------------#------------------------

    0
    Comment actions Permalink
  • 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?

    0
    Comment actions Permalink
  • 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.

    0
    Comment actions Permalink

Please sign in to leave a comment.