Skip to content

getCookie raw vs decoded name/value #588

Open
@bkdotcom

Description

@bkdotcom

What is the expected behavior?

getCookie() : expect arg to accept a decoded name
expect the return value to be decoded

getCookies() expect decoded names/values

responseCookies public property : expect decoded names/values

What is the actual behavior?

must pass an encoded name to getCookie() and it returns a raw/encoded value

What steps will reproduce the problem?

response headers include

Set-Cookie: dingus=foo%3Bbar; path=/
Set-Cookie: a%3Bb=foo%3Bbar; path=/

Code:

$curl->getCookie('dingus') // returns "foo%3Bbar"   I would expect "foo;bar"
$curl->getCookie('a;b'); // returns null, I would expect "foo;bar"
$curl->getCookie('a%3Bb'); // returns "foo%3Bbar"  -> ugh

likewise, I would expect getCookies (and public responseCookies property) to return array of decoded keys/values

feature or bug?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy