{"action":"opened","issue":{"url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/957","repository_url":"https://api.github.com/repos/KeepSafe/aiohttp","labels_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/957/labels{/name}","comments_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/957/comments","events_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/957/events","html_url":"https://github.com/KeepSafe/aiohttp/issues/957","id":163899064,"number":957,"title":"Discarding cookies in client session","user":{"login":"tailhook","id":321799,"avatar_url":"https://avatars.githubusercontent.com/u/321799?v=3","gravatar_id":"","url":"https://api.github.com/users/tailhook","html_url":"https://github.com/tailhook","followers_url":"https://api.github.com/users/tailhook/followers","following_url":"https://api.github.com/users/tailhook/following{/other_user}","gists_url":"https://api.github.com/users/tailhook/gists{/gist_id}","starred_url":"https://api.github.com/users/tailhook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tailhook/subscriptions","organizations_url":"https://api.github.com/users/tailhook/orgs","repos_url":"https://api.github.com/users/tailhook/repos","events_url":"https://api.github.com/users/tailhook/events{/privacy}","received_events_url":"https://api.github.com/users/tailhook/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-05T17:03:27Z","updated_at":"2016-07-05T17:03:27Z","closed_at":null,"body":"It looks like there is no good way to discard cookies after each request.\r\n\r\nIn previous versions of aiohttp I've just used `aiohttp.request(connector=...)` for requests, but it's deprecated now. And it looks like the only way to do connections is to make `ClientSession`.\r\n\r\nBut `ClientSession` has hardcoded cookie processing which I don't need at all. I supply `Cookie` header value to the `client_session.request()`. And it gots replaced as soon as first response returns `Set-Cookie` (I mean `CookieJar` replaces the header on the all following requests), as far as I can observe.\r\n\r\nCurrently, I can fix it by:\r\n```\r\nsession._cookie_jar._cookies.clear()\r\nsession.request(...)\r\n```  \r\nBut it looks like too ugly and wrong.\r\n\r\nThe overall use case is similar to a simple proxy: I maintain multiple server connections and send requests to the backends using a single ClientSession (to maintain a single connection pool for all incoming connections). So `CookieJar`'s implementation handling is just wrong for it.\r\n\r\nAny good ideas how to achieve this using aiohttp?"}}
{"actor":{"display_login":"tailhook"}}