{"action":"created","comment":{"url":"https://api.github.com/repos/racker/falcon/pulls/comments/23559670","id":23559670,"diff_hunk":"@@ -123,6 +133,103 @@ def set_stream(self, stream, stream_len):\n         self.stream = stream\n         self.stream_len = stream_len\n \n+    def set_cookie(self, key, value, **cookie_params):\n+        \"\"\"Set a response cookie.\n+\n+        Args:\n+            key (str): Cookie key name\n+            value (str): Cookie value\n+\n+        Kwargs:\n+            path (str): The Path attribute specifies the subset of URLs to\n+                which this cookie applies.\n+            comment (str): Because cookies can contain private information\n+                about a user, the Cookie attribute allows an origin server to\n+                document its intended use of a cookie. The user can inspect\n+                the information to decide whether to initiate or continue a\n+                session with this cookie.\n+            domain (str): The Domain attribute specifies the domain for\n+                which the cookie is valid.\n+                An explicitly specified domain must always start with a dot.\n+            max_age (int): The Max-Age attribute defines the lifetime of the\n+                cookie, in seconds.  The delta-seconds value is a decimal non-\n+                negative integer.  After delta-seconds seconds elapse,\n+                the client should discard the cookie.\n+                A value of 0 means the cookie should be discarded immediately.\n+            expires (str): Defines when the cookie should expire.\n+                the default is to expire when the browser is closed.\n+                The format given should be \"Wdy, DD Mon YYYY HH:MM:SS GMT\"\n+            secure (bool): The Secure attribute directs the user\n+                agent to use only secure means to contact the origin\n+                server whenever it sends back this cookie.\n+            version (str): The Version attribute, a decimal integer,\n+                identifies to which version of the state management\n+                specification the cookie conforms.\n+            httponly (bool): The attribute httponly specifies that the cookie\n+                is  only transferred in HTTP requests, and is not accessible\n+                through JavaScript. This is intended to mitigate some forms\n+                of cross-site scripting.\n+\n+        Note:\n+            Kwargs and there valid values are all\n+            specified in http://tools.ietf.org/html/rfc2109.html","path":"falcon/response.py","position":74,"original_position":74,"commit_id":"f9dfa720d6ebb7eaaeb42fb923428c6b0749098a","original_commit_id":"f9dfa720d6ebb7eaaeb42fb923428c6b0749098a","user":{"login":"kgriffs","id":719939,"avatar_url":"https://avatars.githubusercontent.com/u/719939?v=3","gravatar_id":"","url":"https://api.github.com/users/kgriffs","html_url":"https://github.com/kgriffs","followers_url":"https://api.github.com/users/kgriffs/followers","following_url":"https://api.github.com/users/kgriffs/following{/other_user}","gists_url":"https://api.github.com/users/kgriffs/gists{/gist_id}","starred_url":"https://api.github.com/users/kgriffs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kgriffs/subscriptions","organizations_url":"https://api.github.com/users/kgriffs/orgs","repos_url":"https://api.github.com/users/kgriffs/repos","events_url":"https://api.github.com/users/kgriffs/events{/privacy}","received_events_url":"https://api.github.com/users/kgriffs/received_events","type":"User","site_admin":false},"body":"Just noticed this is an old RFC... 2109 was superseded by 2965, which in turn has been superseded by http://tools.ietf.org/html/rfc6265.html","created_at":"2015-01-26T20:02:12Z","updated_at":"2015-01-26T20:02:12Z","html_url":"https://github.com/racker/falcon/pull/405#discussion_r23559670","pull_request_url":"https://api.github.com/repos/racker/falcon/pulls/405","_links":{"self":{"href":"https://api.github.com/repos/racker/falcon/pulls/comments/23559670"},"html":{"href":"https://github.com/racker/falcon/pull/405#discussion_r23559670"},"pull_request":{"href":"https://api.github.com/repos/racker/falcon/pulls/405"}}},"pull_request":{"url":"https://api.github.com/repos/racker/falcon/pulls/405","id":26995876,"html_url":"https://github.com/racker/falcon/pull/405","diff_url":"https://github.com/racker/falcon/pull/405.diff","patch_url":"https://github.com/racker/falcon/pull/405.patch","issue_url":"https://api.github.com/repos/racker/falcon/issues/405","number":405,"state":"open","locked":false,"title":"feat(Response) Add cookie helpers","user":{"login":"tbug","id":195468,"avatar_url":"https://avatars.githubusercontent.com/u/195468?v=3","gravatar_id":"","url":"https://api.github.com/users/tbug","html_url":"https://github.com/tbug","followers_url":"https://api.github.com/users/tbug/followers","following_url":"https://api.github.com/users/tbug/following{/other_user}","gists_url":"https://api.github.com/users/tbug/gists{/gist_id}","starred_url":"https://api.github.com/users/tbug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbug/subscriptions","organizations_url":"https://api.github.com/users/tbug/orgs","repos_url":"https://api.github.com/users/tbug/repos","events_url":"https://api.github.com/users/tbug/events{/privacy}","received_events_url":"https://api.github.com/users/tbug/received_events","type":"User","site_admin":false},"body":"Add the following new helpers for setting and getting cookies\r\n\r\n- set_cookie(name : str, value : str, **cookie_params) -> None\r\n- get_cookie(name : str) -> Morsel\r\n- get_cookies() -> List[Morsel]\r\n- unset_cookie(name : str) -> None\r\n\r\nCookies will - if set - be rendered and merged with headers in\r\n_wsgi_headers. For responses that don't use cookies, there will\r\nno performance hit, except for a single \"if cookies is not None:\"\r\ncheck in the _wsgi_headers call.\r\nImplementation use the http.cookies.SimpleCookie (py3) or\r\nCookie.SimpleCookie (py2) from the stdlib.\r\nMight find extra speed in doing our own implementation.\r\n\r\nFixes #292","created_at":"2015-01-07T23:14:27Z","updated_at":"2015-01-26T20:02:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a1969983da5167cc3f9b5c2dda5def9346607c38","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/racker/falcon/pulls/405/commits","review_comments_url":"https://api.github.com/repos/racker/falcon/pulls/405/comments","review_comment_url":"https://api.github.com/repos/racker/falcon/pulls/comments/{number}","comments_url":"https://api.github.com/repos/racker/falcon/issues/405/comments","statuses_url":"https://api.github.com/repos/racker/falcon/statuses/f9dfa720d6ebb7eaaeb42fb923428c6b0749098a","head":{"label":"tbug:feature/cookiehelpers","ref":"feature/cookiehelpers","sha":"f9dfa720d6ebb7eaaeb42fb923428c6b0749098a","user":{"login":"tbug","id":195468,"avatar_url":"https://avatars.githubusercontent.com/u/195468?v=3","gravatar_id":"","url":"https://api.github.com/users/tbug","html_url":"https://github.com/tbug","followers_url":"https://api.github.com/users/tbug/followers","following_url":"https://api.github.com/users/tbug/following{/other_user}","gists_url":"https://api.github.com/users/tbug/gists{/gist_id}","starred_url":"https://api.github.com/users/tbug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbug/subscriptions","organizations_url":"https://api.github.com/users/tbug/orgs","repos_url":"https://api.github.com/users/tbug/repos","events_url":"https://api.github.com/users/tbug/events{/privacy}","received_events_url":"https://api.github.com/users/tbug/received_events","type":"User","site_admin":false},"repo":{"id":26658808,"name":"falcon","full_name":"tbug/falcon","owner":{"login":"tbug","id":195468,"avatar_url":"https://avatars.githubusercontent.com/u/195468?v=3","gravatar_id":"","url":"https://api.github.com/users/tbug","html_url":"https://github.com/tbug","followers_url":"https://api.github.com/users/tbug/followers","following_url":"https://api.github.com/users/tbug/following{/other_user}","gists_url":"https://api.github.com/users/tbug/gists{/gist_id}","starred_url":"https://api.github.com/users/tbug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbug/subscriptions","organizations_url":"https://api.github.com/users/tbug/orgs","repos_url":"https://api.github.com/users/tbug/repos","events_url":"https://api.github.com/users/tbug/events{/privacy}","received_events_url":"https://api.github.com/users/tbug/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tbug/falcon","description":"Falcon is a high-performance Python framework for building cloud APIs and web app backends.","fork":true,"url":"https://api.github.com/repos/tbug/falcon","forks_url":"https://api.github.com/repos/tbug/falcon/forks","keys_url":"https://api.github.com/repos/tbug/falcon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tbug/falcon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tbug/falcon/teams","hooks_url":"https://api.github.com/repos/tbug/falcon/hooks","issue_events_url":"https://api.github.com/repos/tbug/falcon/issues/events{/number}","events_url":"https://api.github.com/repos/tbug/falcon/events","assignees_url":"https://api.github.com/repos/tbug/falcon/assignees{/user}","branches_url":"https://api.github.com/repos/tbug/falcon/branches{/branch}","tags_url":"https://api.github.com/repos/tbug/falcon/tags","blobs_url":"https://api.github.com/repos/tbug/falcon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tbug/falcon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tbug/falcon/git/refs{/sha}","trees_url":"https://api.github.com/repos/tbug/falcon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tbug/falcon/statuses/{sha}","languages_url":"https://api.github.com/repos/tbug/falcon/languages","stargazers_url":"https://api.github.com/repos/tbug/falcon/stargazers","contributors_url":"https://api.github.com/repos/tbug/falcon/contributors","subscribers_url":"https://api.github.com/repos/tbug/falcon/subscribers","subscription_url":"https://api.github.com/repos/tbug/falcon/subscription","commits_url":"https://api.github.com/repos/tbug/falcon/commits{/sha}","git_commits_url":"https://api.github.com/repos/tbug/falcon/git/commits{/sha}","comments_url":"https://api.github.com/repos/tbug/falcon/comments{/number}","issue_comment_url":"https://api.github.com/repos/tbug/falcon/issues/comments/{number}","contents_url":"https://api.github.com/repos/tbug/falcon/contents/{+path}","compare_url":"https://api.github.com/repos/tbug/falcon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tbug/falcon/merges","archive_url":"https://api.github.com/repos/tbug/falcon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tbug/falcon/downloads","issues_url":"https://api.github.com/repos/tbug/falcon/issues{/number}","pulls_url":"https://api.github.com/repos/tbug/falcon/pulls{/number}","milestones_url":"https://api.github.com/repos/tbug/falcon/milestones{/number}","notifications_url":"https://api.github.com/repos/tbug/falcon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tbug/falcon/labels{/name}","releases_url":"https://api.github.com/repos/tbug/falcon/releases{/id}","created_at":"2014-11-14T21:42:55Z","updated_at":"2015-01-07T19:01:49Z","pushed_at":"2015-01-07T23:18:40Z","git_url":"git://github.com/tbug/falcon.git","ssh_url":"git@github.com:tbug/falcon.git","clone_url":"https://github.com/tbug/falcon.git","svn_url":"https://github.com/tbug/falcon","homepage":"http://falconframework.org","size":5294,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"racker:master","ref":"master","sha":"ee82fb1c415b10896d236dbc934ebbe5198eb8d5","user":{"login":"racker","id":556922,"avatar_url":"https://avatars.githubusercontent.com/u/556922?v=3","gravatar_id":"","url":"https://api.github.com/users/racker","html_url":"https://github.com/racker","followers_url":"https://api.github.com/users/racker/followers","following_url":"https://api.github.com/users/racker/following{/other_user}","gists_url":"https://api.github.com/users/racker/gists{/gist_id}","starred_url":"https://api.github.com/users/racker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/racker/subscriptions","organizations_url":"https://api.github.com/users/racker/orgs","repos_url":"https://api.github.com/users/racker/repos","events_url":"https://api.github.com/users/racker/events{/privacy}","received_events_url":"https://api.github.com/users/racker/received_events","type":"Organization","site_admin":false},"repo":{"id":7040500,"name":"falcon","full_name":"racker/falcon","owner":{"login":"racker","id":556922,"avatar_url":"https://avatars.githubusercontent.com/u/556922?v=3","gravatar_id":"","url":"https://api.github.com/users/racker","html_url":"https://github.com/racker","followers_url":"https://api.github.com/users/racker/followers","following_url":"https://api.github.com/users/racker/following{/other_user}","gists_url":"https://api.github.com/users/racker/gists{/gist_id}","starred_url":"https://api.github.com/users/racker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/racker/subscriptions","organizations_url":"https://api.github.com/users/racker/orgs","repos_url":"https://api.github.com/users/racker/repos","events_url":"https://api.github.com/users/racker/events{/privacy}","received_events_url":"https://api.github.com/users/racker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/racker/falcon","description":"Falcon is a high-performance Python framework for building cloud APIs and web app backends.","fork":false,"url":"https://api.github.com/repos/racker/falcon","forks_url":"https://api.github.com/repos/racker/falcon/forks","keys_url":"https://api.github.com/repos/racker/falcon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/racker/falcon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/racker/falcon/teams","hooks_url":"https://api.github.com/repos/racker/falcon/hooks","issue_events_url":"https://api.github.com/repos/racker/falcon/issues/events{/number}","events_url":"https://api.github.com/repos/racker/falcon/events","assignees_url":"https://api.github.com/repos/racker/falcon/assignees{/user}","branches_url":"https://api.github.com/repos/racker/falcon/branches{/branch}","tags_url":"https://api.github.com/repos/racker/falcon/tags","blobs_url":"https://api.github.com/repos/racker/falcon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/racker/falcon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/racker/falcon/git/refs{/sha}","trees_url":"https://api.github.com/repos/racker/falcon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/racker/falcon/statuses/{sha}","languages_url":"https://api.github.com/repos/racker/falcon/languages","stargazers_url":"https://api.github.com/repos/racker/falcon/stargazers","contributors_url":"https://api.github.com/repos/racker/falcon/contributors","subscribers_url":"https://api.github.com/repos/racker/falcon/subscribers","subscription_url":"https://api.github.com/repos/racker/falcon/subscription","commits_url":"https://api.github.com/repos/racker/falcon/commits{/sha}","git_commits_url":"https://api.github.com/repos/racker/falcon/git/commits{/sha}","comments_url":"https://api.github.com/repos/racker/falcon/comments{/number}","issue_comment_url":"https://api.github.com/repos/racker/falcon/issues/comments/{number}","contents_url":"https://api.github.com/repos/racker/falcon/contents/{+path}","compare_url":"https://api.github.com/repos/racker/falcon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/racker/falcon/merges","archive_url":"https://api.github.com/repos/racker/falcon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/racker/falcon/downloads","issues_url":"https://api.github.com/repos/racker/falcon/issues{/number}","pulls_url":"https://api.github.com/repos/racker/falcon/pulls{/number}","milestones_url":"https://api.github.com/repos/racker/falcon/milestones{/number}","notifications_url":"https://api.github.com/repos/racker/falcon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/racker/falcon/labels{/name}","releases_url":"https://api.github.com/repos/racker/falcon/releases{/id}","created_at":"2012-12-06T18:17:51Z","updated_at":"2015-01-26T18:12:58Z","pushed_at":"2015-01-26T18:12:58Z","git_url":"git://github.com/racker/falcon.git","ssh_url":"git@github.com:racker/falcon.git","clone_url":"https://github.com/racker/falcon.git","svn_url":"https://github.com/racker/falcon","homepage":"http://falconframework.org","size":11219,"stargazers_count":1456,"watchers_count":1456,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":156,"mirror_url":null,"open_issues_count":143,"forks":156,"open_issues":143,"watchers":1456,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/racker/falcon/pulls/405"},"html":{"href":"https://github.com/racker/falcon/pull/405"},"issue":{"href":"https://api.github.com/repos/racker/falcon/issues/405"},"comments":{"href":"https://api.github.com/repos/racker/falcon/issues/405/comments"},"review_comments":{"href":"https://api.github.com/repos/racker/falcon/pulls/405/comments"},"review_comment":{"href":"https://api.github.com/repos/racker/falcon/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/racker/falcon/pulls/405/commits"},"statuses":{"href":"https://api.github.com/repos/racker/falcon/statuses/f9dfa720d6ebb7eaaeb42fb923428c6b0749098a"}}}}