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

6.3 set_cookie() got an unexpected keyword argument 'HttpOnly' #3252

Closed
eljeffeg opened this issue Apr 18, 2023 · 2 comments · Fixed by #3254
Closed

6.3 set_cookie() got an unexpected keyword argument 'HttpOnly' #3252

eljeffeg opened this issue Apr 18, 2023 · 2 comments · Fixed by #3254

Comments

@eljeffeg
Copy link

eljeffeg commented Apr 18, 2023

Getting this issue changing from Tornado 6.2 -> 6.3

rtb-webapp-1     | [E 230418 15:28:08 BaseHandlers:195] Request from x.x.x.x resulted in an error code 500:
rtb-webapp-1     |     Traceback (most recent call last):
rtb-webapp-1     |       File "/usr/local/lib/python3.8/site-packages/tornado/web.py", line 1767, in _execute
rtb-webapp-1     |         result = method(*self.path_args, **self.path_kwargs)
rtb-webapp-1     |       File "/opt/rtb/libs/SecurityDecorators.py", line 106, in wrapper
rtb-webapp-1     |         return method(self, *args, **kwargs)
rtb-webapp-1     |       File "/opt/rtb/handlers/PublicHandlers.py", line 224, in post
rtb-webapp-1     |         self.valid_login(user)
rtb-webapp-1     |       File "/opt/rtb/handlers/PublicHandlers.py", line 276, in valid_login
rtb-webapp-1     |         self.successful_login(user)
rtb-webapp-1     |       File "/opt/rtb/handlers/PublicHandlers.py", line 291, in successful_login
rtb-webapp-1     |         self.start_session()
rtb-webapp-1     |       File "/opt/rtb/handlers/BaseHandlers.py", line 102, in start_session
rtb-webapp-1     |         self.set_secure_cookie("session_id", self.session.session_id, **flags)
rtb-webapp-1     |       File "/usr/local/lib/python3.8/site-packages/tornado/web.py", line 756, in set_signed_cookie
rtb-webapp-1     |         self.set_cookie(
rtb-webapp-1     |     TypeError: set_cookie() got an unexpected keyword argument 'HttpOnly'
@eljeffeg eljeffeg changed the title set_cookie() got an unexpected keyword argument 'HttpOnly' 6.3 set_cookie() got an unexpected keyword argument 'HttpOnly' Apr 18, 2023
@bdarnell
Copy link
Member

Oops, looks like the http.cookies module has some case-insensitive magic that I missed. I'll get this fixed, but in the meantime you can work around it by changing to lowercase httponly (it looks like **flags in your code contains HttpOnly).

bdarnell added a commit to bdarnell/tornado that referenced this issue Apr 21, 2023
This was an unintended feature that got broken in tornadoweb#3224. Bring it back
for now but deprecate it for future cleanup.

Fixes tornadoweb#3252
bdarnell added a commit to bdarnell/tornado that referenced this issue Apr 21, 2023
This was an unintended feature that got broken in tornadoweb#3224. Bring it back
for now but deprecate it for future cleanup.

Fixes tornadoweb#3252
bdarnell added a commit to bdarnell/tornado that referenced this issue Apr 21, 2023
This was an unintended feature that got broken in tornadoweb#3224. Bring it back
for now but deprecate it for future cleanup.

Fixes tornadoweb#3252
bdarnell added a commit to bdarnell/tornado that referenced this issue Apr 21, 2023
This was an unintended feature that got broken in tornadoweb#3224. Bring it back
for now but deprecate it for future cleanup.

Fixes tornadoweb#3252
bdarnell added a commit to bdarnell/tornado that referenced this issue Apr 21, 2023
This was an unintended feature that got broken in tornadoweb#3224. Bring it back
for now but deprecate it for future cleanup.

Fixes tornadoweb#3252
@bdarnell
Copy link
Member

This is fixed in Tornado 6.3.1, which was just released.

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 a pull request may close this issue.

2 participants