Request: how to carry the cookies split by ; symbol?

Created on 11 Sep 2016  ·  3Comments  ·  Source: request/request

here's a example:
if there are at lease two keys need to be carried such as : {"a":"1","b":"2"}
and then if I code like this:

var cookie = request.cookie('a=1;b=2');

We will find out that the second key might be lost at the request
How to resolve it?

stale

Most helpful comment

cookie = 'a=1;b=2'
 cookie.split(';').forEach((x) => {
      jar.setCookie(request.cookie(x), 'https://vtop.vit.ac.in/student/stud_login_submit.asp')
})

this is how i added multiple cookie for detailed example check this out
(https://github.com/sch00lb0y/Vit-Photo/blob/master/scripts/lib.js)

All 3 comments

I have the same problem, have you resolved it?

cookie = 'a=1;b=2'
 cookie.split(';').forEach((x) => {
      jar.setCookie(request.cookie(x), 'https://vtop.vit.ac.in/student/stud_login_submit.asp')
})

this is how i added multiple cookie for detailed example check this out
(https://github.com/sch00lb0y/Vit-Photo/blob/master/scripts/lib.js)

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings