Skip to content

Cookies for different domains with same name disappear #1125

Closed
@JeckLabs

Description

It seems that cookies are stored in key / value dictionary that causing the problem in the storing cookies from different domains / subdomains in one session.

with aiohttp.ClientSession() as client:

    async with client.get('https://httpbin.org/cookies/set?test=ok') as resp:
        logging.info(await resp.json())

    async with client.get('https://httpbin.org/cookies') as resp:
        logging.info(await resp.json())

    async with client.get('https://http2bin.org/cookies/set?test=fail') as resp:
        logging.info(await resp.json())

    async with client.get('https://httpbin.org/cookies') as resp:
        logging.info(await resp.json())

    logger.info(client.cookies)
2016-08-25 21:57:38 INFO {'cookies': {'test_cookie': 'ok'}}
2016-08-25 21:57:39 INFO {'cookies': {'test_cookie': 'ok'}}
2016-08-25 21:57:39 INFO {'cookies': {'test_cookie': 'fail'}}
2016-08-25 21:57:39 INFO {'cookies': {}}

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions