peterbe/tornado-utils — pull request #8 by bootandy (2012-06-14 08:51:20+00:00)
Title:  cookie can now handle more than 1 value being set

This pull is including a commit you made 3 months ago. I don't know why it would do that. I didn't know this repo existed until a week ago let alone 3 months ago.

This commit is to fix this behaviour:
I have the below code in my app but it doesn't work without the patch as the test framework only remembers 1 cookie. This is seen in python 2.7 with Tornado 2.2.

(In a tornado handler):
handler.set_secure_cookie('user_details_id', 'i like bananas')
handler.set_secure_cookie('user', 'andy')

According to the source Cookie extends dict so I assume that makes 'update()' behave like adding a new entry to a hash and therefore multiple update() calls are fine.
http://hg.python.org/cpython/file/2.7/Lib/Cookie.py

Let me know if you think this is ok. & If it merges correctly this time