Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Issues with Cookies being cleared on in version 2.22.1 #591

Closed
n99 opened this Issue · 6 comments

3 participants

@n99

Hi
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?

cheers

@n99
@mikeal
Owner

any thoughts @threepointone ?

@threepointone

I just tried this (edit: with master)-

var r = request({url: 'http://www.google.com', jar: null}, function(err, res){
    console.log('req1', r.headers);
    console.log('res1', res.headers);
    var r2 = request({url: 'http://www.google.com', 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?

@threepointone

also, to clear state, simply use a new jar

request({url: 'http://www.mysite.com', jar: request.jar()}, function(err, res){});
@mikeal
Owner

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.