[ic] Cookie setting refactor

Jon Jensen jon at endpoint.com
Wed Jan 11 16:46:41 UTC 2017


I'd like any review/input I can get on this minor refactor of the routine 
that builds Set-Cookie headers:


The initial impetus for changing it was that it adds multiple ;; and extra 
whitespace in some cases, due to the way it's concatenating strings with 
some conditionals happening and some not.

The extra ; and whitespace didn't break anything because the cookie spec 
is tolerant of extra junk in there, but it made me have to go check and 
test in browsers to be sure.

It's faster (on a microoptimization level) to build up strings in an array 
and join afterwards, which also avoids any extra separators, so I did it 
that way.

This has been running in production at one busy site for a week or so.


Jon Jensen
End Point Corporation

More information about the interchange-users mailing list