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

add cookie path #544

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

prabirshrestha
Copy link

Not using path in cookies can lead to unexpected behaviors as you may land with the same cookie name but different paths. Updated the example to always use path.

Another option would be default the path to / but not sure if this would cause security issues. .NET does exactly what tide is currently doing. I personally believe there shouldn't be an api to only set name and value for a cookie without domain and path but that is for another discussion. These days I tend to say never to use framework apis for cookies but instead always use the wrapper so it is done in a safe way.

Also updated the example to handle when cookie is not present as the first time I ran it my initial impression was cookie example was broken since .unwrap() was causing crash.

@goto-bus-stop goto-bus-stop changed the base branch from master to main August 9, 2020 12:56
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

Successfully merging this pull request may close these issues.

None yet

1 participant