Skip to content
Myr

Added support for deleting cookies via Request#cookie('key', null)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Aaron Heckmann · committed by visionmedia · parent b900a59 · Browse files · 2 files+13 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+13 added−1 removed

  • tests:+9 added−0 removed
  • other:+4 added−1 removed

2 files+13 added−1 removed

modified:lib/express/plugins/cookie.js+4 added-1 removed
modified:spec/spec.plugins.cookie.js+9 added
97 unmodified lines
98 return '' 99 })100 get('/user').headers['Set-Cookie'].should.eql 'SID=732423sdfs73243; path=/; secure\r\nSet-Cookie: foo=bar; path=/'101 end102 103 it 'should delete the cookie'104 get('/user', function(){105 this.cookie('ninja', null)106 this.cookie('pirate', null)107 return '' 108 })109 get('/user').headers['Set-Cookie'].should.eql 'ninja=delete; path=/; expires=Thu, 01 Jan 1970 02:46:40 GMT\r\nSet-Cookie: pirate=delete; path=/; expires=Thu, 01 Jan 1970 02:46:40 GMT'110 end111112 it 'should support URL unfriendly characters'113 get('/user', function(){114 this.cookie('spaceship', '<*==*>', { path: '/', secure: true })
19 unmodified lines