Skip to content

Same name cookies #51753

Closed
Closed

Description

@chch
mannequin
BPO 7504
Nosy @terryjreedy, @amauryfa
Superseder
  • bpo-1375011: http.cookies, Cookie.py: Improper handling of duplicate cookies
  • Files
  • Cookie.py.diff
  • Cookie_multi.diff: remake with svn
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2016-04-25.12:01:01.162>
    created_at = <Date 2009-12-14.13:54:27.486>
    labels = ['type-feature', 'library']
    title = 'Same name cookies'
    updated_at = <Date 2016-04-25.12:01:01.161>
    user = 'https://bugs.python.org/chch'

    bugs.python.org fields:

    activity = <Date 2016-04-25.12:01:01.161>
    actor = 'berker.peksag'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-04-25.12:01:01.162>
    closer = 'berker.peksag'
    components = ['Library (Lib)']
    creation = <Date 2009-12-14.13:54:27.486>
    creator = 'chch'
    dependencies = []
    files = ['15554', '15606']
    hgrepos = []
    issue_num = 7504
    keywords = ['patch']
    message_count = 8.0
    messages = ['96375', '96595', '96596', '96597', '112727', '112753', '182764', '182817']
    nosy_count = 4.0
    nosy_names = ['terry.reedy', 'amaury.forgeotdarc', 'chch', 'mmelin']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '1375011'
    type = 'enhancement'
    url = 'https://bugs.python.org/issue7504'
    versions = ['Python 3.2']

    Activity

    1. chch commented on Dec 14, 2009

      chchmannequin
      MannequinAuthor

      After setting cookies with same name and different path only nearest to
      root cookie is available.

      Attached patch:

      1. Set Cookie to nearest value.
      2. Collects all same name values in Cookie._multi['<cookie name>'] in
        order.
    2. added
      type-bugAn unexpected behavior, bug, or error
      stdlibStandard Library Python modules in the Lib/ directory
      on Dec 14, 2009
    3. chch commented on Dec 19, 2009

      chchmannequin
      MannequinAuthor

      Remake for patch due the requirements of
      http://www.python.org/dev/patches/

    4. amauryfa commented on Dec 19, 2009

      @amauryfa
      Contributor

      For this kind of report you should provide more information. Is this an
      enhancement to the Cookie object? Why is it needed?
      Do you really propose that users directly use the _multi attribute
      directly (the leading _ suggest an internal attribute)?
      Also, some documentation update is necessary (in Doc/library/cookie.rst)

    5. chch commented on Dec 19, 2009

      chchmannequin
      MannequinAuthor

      This is fix for rare problem. If I set 2 cookies:
      sid=pub.GHoBitAWLt, path="/"
      sid=cab.S97jUfeihM, path="/cab"
      All browsers in Cookie header send for any URL '/cab*':
      sid=cab.S97jUfeihM; sid=pub.GHoBitAWLt
      Current implementation always returns Cookie['sid']=pub.GHoBitAWLt - wrong!
      My patch resolve this problem and Cookie['sid'] returns first (nearest/deepest in path) cookie value,
      and also collects all same name cookies in dict Cookie._multi .

      Name (_multi) may be wrong, and may be any other :o) .

      Also I can update documentation, but my English is not so good ...

    6. terryjreedy commented on Aug 4, 2010

      @terryjreedy
      Member

      Unless you can quote something in the manual that says or implies that cookie.py should already have this feature, it looks like a feature request. Is it possible to add a new unittest? Prepare any new patches against py3k branch, now 'trunk'.

    7. added
      type-featureA feature request or enhancement
      and removed
      type-bugAn unexpected behavior, bug, or error
      on Aug 4, 2010
    8. chch commented on Aug 4, 2010

      chchmannequin
      MannequinAuthor
      1. Cookie.py.diff is fix for error, very rare error.
      2. Cookie_multi.diff is extention for supporting same name cookies set for diferent pathes.

      Cookie.py contain error!

    9. mmelin commented on Feb 23, 2013

      mmelinmannequin
      Mannequin

      FYI, this looks like the same issue as bpo-1375011

    10. terryjreedy commented on Feb 23, 2013

      @terryjreedy
      Member

      Which also has patches.

    11. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions