Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve unknown cookie attributes #3

Merged
merged 1 commit into from Jun 10, 2019
Merged

Conversation

kelunik
Copy link
Member

@kelunik kelunik commented Mar 15, 2018

Fixes #2.

Unknown attributes are intentionally only preserved when using fromHeader().

@kelunik kelunik requested review from trowski and bwoebi March 15, 2018 13:15
@bwoebi
Copy link
Member

bwoebi commented Mar 15, 2018

Will it also be possible to add custom flags to a cookie (apart from directly using Response::setHeader())? If not, why not?

@kelunik
Copy link
Member Author

kelunik commented Mar 15, 2018

Not sure whether we should allow that. I'd have to work for all attributes then and might circumvent validation checks. If we won't circumvent validation checks, we might end up with an invalid CookieAttributes instance. If we validate it, there will be a BC break if we add support for new attributes.

@kelunik
Copy link
Member Author

kelunik commented Mar 15, 2018

@bwoebi You can always use Response::setHeader('set-cookie', (string) $cookie . '; customAttribute=XY');

@kelunik kelunik force-pushed the preserve-unknown-attributes branch 2 times, most recently from eaf1f15 to 9ecc36c Compare March 15, 2018 16:48
@trowski
Copy link
Member

trowski commented Mar 19, 2018

Should we have a method to get the array of unknown attributes?

@kelunik
Copy link
Member Author

kelunik commented Mar 31, 2018

@trowski No, as any usage of that method will break once support for the used attribute has been implemented.

@kelunik kelunik force-pushed the preserve-unknown-attributes branch from 9ecc36c to 6453a59 Compare June 10, 2019 17:44
@kelunik kelunik force-pushed the preserve-unknown-attributes branch from 6453a59 to 52e3bb1 Compare June 10, 2019 17:49
@kelunik kelunik merged commit 91c023a into master Jun 10, 2019
@kelunik kelunik deleted the preserve-unknown-attributes branch June 10, 2019 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Preserve unknown cookie attributes
3 participants