Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Issues with Cookies being cleared on in version 2.22.1 #591

n99 opened this Issue · 6 comments

3 participants


Noticed this version is accompanied with comments
"global cookie jar disabled by default, send jar: true to enable."
this is great :)

I've pulled down version 2.22.1 and am using it with default settings for a Basic Auth request.

However, I can still see cookies set from previous requests being sent with subsequent requests while snooping the http traffic.......

Also Is there a method to clear state at all? ie "request.clear()" or something?



any thoughts @threepointone ?


I just tried this (edit: with master)-

var r = request({url: '', jar: null}, function(err, res){
    console.log('req1', r.headers);
    console.log('res1', res.headers);
    var r2 = request({url: '', jar: null}, function(err, res2){
        console.log('req2', r2.headers);
        console.log('res2', res2.headers);

with jar as null, true, false. the headers seem to be as expected. @n99 - got a code sample I can see?


also, to clear state, simply use a new jar

request({url: '', jar: request.jar()}, function(err, res){});

new version was recently released.

@mikeal mikeal closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.