Skip to content

Optional encoder function, in addition to decoder (converter) #70

Closed
@dezlov

Description

@dezlov

This will allow for ultimate customization and compatibility with other cookie encoding functions.

It could be added as an extension to Cookies.withConverter() to allow specifying an encoding function too.

For example, the incompatibility with PHP cannot be resolved because this JS library will always store "+" signs in plain text, while PHP will always convert them to spaces when read.

In PHP, both $_COOKIE and filter_input(INPUT_COOKIE) will return already decoded value, where all "+" signs will be converted to spaces. There is a setrawcookie, but no getrawcookie function, so no way around it in PHP (without having to manually double encode and decode in both languages).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions