pallets / flask

The Python micro framework for building web applications.
https://flask.palletsprojects.com
BSD 3-Clause "New" or "Revised" License
67.87k stars 16.2k forks source link

feat: Adding SESSION_COOKIE_PARTITIONED #5499

Open Josecespedesant opened 4 months ago

Josecespedesant commented 4 months ago

This pull request is related to Add support for partitioned session cookies

fixes #5472

Regarding the commit Adding code to handle SESSION_COOKIE_SECURE I see that in the test_basic.py in line 20 is using import flask, I believe this is the reason I got this error as it's using the package installed via pip install flask and not the code contained in /src/flask/

E       AssertionError: assert 'partitioned' in 'session=eyj0zxn0aw5nijo0mn0.zmzhyw.hgj68cffl4hz1avfswp08uya5ya; domain=example.com; secure; path=/; samesite=lax'

I'd like to learn if I'm doing something wrong with this to correct it and modify the PR

davidism commented 4 months ago

I believe this is the reason I got this error as it's using the package installed via pip install flask and not the code contained in /src/flask/

I'm not sure what you mean here. You should follow our contributing guide to set up your development environment. It instructs you to do pip install -e . during the setup. You can also run tox to set up test envs for you. The failure does not appear to be related.

Josecespedesant commented 4 months ago

Hello, thank you for your response, I went ahead and applied changes without taking a look at the contribution guide, I just went through it and will make the process correctly, my apologies.

davidism commented 3 months ago

So the immediate reason this wouldn't work is because it needs to depend on Werkzeug 3.1, which is not yet released. But after that, you didn't actually use the get_cookie_partitioned method to pass the parameter to set_cookie. I've corrected that, and will merge this once Werkzeug 3.1 is available.