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

Handling of 'Secure' prefixes - __Secure- and __Host- #36

Open
siktec-lab opened this issue Jul 8, 2024 · 0 comments
Open

Handling of 'Secure' prefixes - __Secure- and __Host- #36

siktec-lab opened this issue Jul 8, 2024 · 0 comments

Comments

@siktec-lab
Copy link

I might be buggin, but I can't see the use of the PREFIX_SECURE and PREFIX_HOST constants in the Cookie class.
As I understand it, Set-Cookie that are prefixed with __Secure- and __Host- have special meanings and should be processed differently.
I would expect to see these prefixes appended to the cookie name when the cookie is being set in buildCookieHeader
Or removed when the cookie is being parsed in parse (while setting a special flag or something to indicate that the cookie is prefixed and with what).

I know that some of the implementations out there don't handle these prefixes correctly, but they should be implemented as they are part of the standard, and the only way to distinguish between a Secure only (HTTPS) cookie and a Secure only + host (HTTPS + Path).

Maybe I'm missing something, I would appreciate it if you could clarify this for me.

I used your code as a reference for a cookie class in my own project - I noticed that I didn't handle these prefixes either, so I implemented them and I thought I'd ask you about it.

Thanks for your time.

@siktec-lab siktec-lab changed the title Handling of 'Secure' prefixes - __Secure- and __Host Handling of 'Secure' prefixes - __Secure- and __Host- Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant