feat(http): add cookie config options to control unencrypted cookie discarding#2132
Conversation
innocenzi
left a comment
There was a problem hiding this comment.
Looks good, just a few minor changes
Benchmark ResultsComparison of Open to see the benchmark resultsNo benchmark changes above ±5%. Generated by phpbench against commit bd6089f |
|
Also feel free to add an entry to the docs mentioning this new config: https://github.com/tempestphp/tempest-framework/blob/3.x/docs/1-essentials/01-routing.md I just noticed we don't mention cookies at all there. For now, you can add a section before "Session management" ## Cookie management
### Configuration
…I'll add the rest of the docs for cookies after this is merged |
|
Can you take a look at the failing tests? |
|
I'm sorry, I am not super familiar with this process. Do I need to do something else to complete this? |
|
@rexpl just forgot to merge after my small changes. Thanks for the PR! |
I was surprised by the default Tempest behaviour of discarding any cookie it did not encrypt itself. Cookies from other legitimate services (ex: reverse proxy) would silently get discarded. Two new
CookieConfigoptions allow developers to handle this:discardUnencryptedCookiesto disable discarding entirely, andplaintextCookiesto allowlist specific cookies by name.Original behaviour is preserved, but can now be opted out (fully or partially).