Skip to content

Cookies for different domains with same name disappear #1125

@JeckLabs

Description

@JeckLabs

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions