Tag Archives: cookies

Node.js Set cookies on HTTPS Requests

If you are not sure how to set up cookies with Node.js and HTTPS / HTTP requests to a specific page then this will definitely help you understand how you can do it.

I’ve confronted with this confusion too since I did not find much on the documentation of specific Node.js libraries that provide requests.

Lets say you have a Node.js https.get and you want to send a request to a specific page but you need a cookie in order to access that page for some reason. Here is how it should look :

 

If you want to send multiple cookies in one request then it would look something like this

 

Hope this helps you ! Have a nice day