Cookie setting refactor
Jon Jensen <[email protected]>
| Newsgroups | gmane.comp.web.interchange.users |
|---|---|
| Message-ID | <alpine.LFD.2.20.1701110942550.2699@cevzz> |
Interchangers, I'd like any review/input I can get on this minor refactor of the routine that builds Set-Cookie headers: https://github.com/jonjensen/interchange/commit/69c6a24c2377ccb335bda3f1ff90ff636869ea82 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. Thanks, Jon -- Jon Jensen End Point Corporation https://www.endpoint.com/