expressjs / expressjs/session

Not possible to set cookie encode option

Open
#883 1 comment 2 reactions 0 assignees View on GitHub
discuss enhancement
Dominant language
JavaScript
Stars
6.4k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

One of the options which can be set on `cookie.serialize` is `encode` [see here](https://github.com/jshttp/cookie#encode)

In `express-session` it is not possible to set this option:
- https://github.com/expressjs/session/blob/5df613c481bc7c5979aeaeac691b64ef0a5c4948/index.js#L161
- https://github.com/expressjs/session/blob/5df613c481bc7c5979aeaeac691b64ef0a5c4948/index.js#L243
- https://github.com/expressjs/session/blob/5df613c481bc7c5979aeaeac691b64ef0a5c4948/index.js#L657
- https://github.com/expressjs/session/blob/5df613c481bc7c5979aeaeac691b64ef0a5c4948/session/cookie.js#L117-L127

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.