Commit Graph

10 Commits

Author SHA1 Message Date
Jon Church
82fc12a40b
Ignore expires and maxAge in res.clearCookie() (#5792)
* add test for removing user provided expires

* rework impl and tests to ignore maxAge, do not set it

this is to take into account the built-in relative expires when passing
a maxAge to res.cookie

I realized that using maxAge to invalidate cookies inherrently hit this
relativee expires behavior, and the goal of this PR is not to rework
that relative expires behavior w/ maxAge, but to prevent users from
overwriting these values by accident when clearing cookies

* update history.md

* explicitly delete maxAge instead of setting as undefined

* drop the spread, use object.assign

* wording, review comment on history.md

Co-authored-by: Chris de Almeida <ctcpip@users.noreply.github.com>

* ♻️ use spread, update supported ecmascript version

---------

Co-authored-by: Chris de Almeida <ctcpip@users.noreply.github.com>
2024-08-02 15:26:45 -05:00
Douglas Christopher Wilson
a65913776d tests: use strict mode 2022-02-09 01:07:08 -05:00
Douglas Christopher Wilson
dc8acc8676 tests: use supertest expect for simple assertions 2017-03-05 00:04:47 -05:00
Jonathan Ong
643397ed21 remove unnecessary test/support/http 2014-03-05 22:06:14 -08:00
TJ Holowaychuk
0f5560eebd updated tests to use "supertest" 2012-06-26 17:14:07 -07:00
TJ Holowaychuk
02d43846f6 fixing cookies for connect 2.3.1 2012-06-06 12:25:14 -07:00
TJ Holowaychuk
386a9e88b4 removed old tests 2011-12-17 13:43:51 -08:00
Tj Holowaychuk
87b991c076 removed "root" setting
screw it, no one will understand anyway
2011-11-24 14:27:28 -08:00
Tj Holowaychuk
0f2f3d4e29 Fixed res.clearCookie(), default path to "root" setting 2011-11-08 18:25:21 -08:00
Tj Holowaychuk
bc673bef79 Added res.clearCookie() tests 2011-11-08 18:21:08 -08:00