Setting multiple cookies for open-uri

I am trying to figure out how I would use ['set-cookie']

to add multiple cookies to a request for a web page. If I had the cookies in the array as such:

cookie1 = {'domain': 'Website', 'name': 'xyz', 'value': 'ASH', 'path': '/', 'httpOnly': False, 'secure': False}

cookie2 = {'domain': 'Website', 'name': 'xyz', 'value': 'ASH', 'path': '/', 'httpOnly': False, 'secure': False}


page = Nokogiri::HTML(open("a webpage"), "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36", "Cookie" => cookie1['set-cookie'] cookie2['set-cookie']) 

      

I have struggled to find documentation on how this integrates into open-uri.

+3
ruby cookies open-uri


source to share


No one has answered this question yet

Check out similar questions:

1201
How do I set / remove a cookie using jQuery?
863
Local storage versus cookies
451
Set cookie and get cookie with JavaScript.
12
How can I set a "safe" flag for cookies in an ASP.NET MVC website?
4
Chrome will lose cookies
3
How do I set up a request cookie using the rest of the information?
3
Cookies are not passed in mobile browser in graphql request via relayjs
0
php apache cannot set cookie
0
What cookie attributes uniquely identify a cookie?



All Articles
Loading...
X
Show
Funny
Dev
Pics