Skip to content

Not possible to set cookie encode option #883

Open
@thomasmarr

Description

@thomasmarr

One of the options which can be set on cookie.serialize is encode see here

In express-session it is not possible to set this option:

  • req.session.cookie = new Cookie(cookieOptions);
  • setcookie(res, name, req.sessionID, secrets[0], req.session.cookie.data);
  • var data = cookie.serialize(name, signed, options);
  • session/session/cookie.js

    Lines 117 to 127 in 5df613c

    get data() {
    return {
    originalMaxAge: this.originalMaxAge
    , expires: this._expires
    , secure: this.secure
    , httpOnly: this.httpOnly
    , domain: this.domain
    , path: this.path
    , sameSite: this.sameSite
    }
    },

I believe express-session should expose this, as the default encodeUriComponent is not always the desired behaviour. I would be willing to try and put a PR together for this if it was likely to be merged promptly.

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