# Get all cookies from a website

**URL:** <https://www.ruby-forum.com/t/get-all-cookies-from-a-website/169794>\
**Category:** Ruby\
**Created:** [June 8, 2009, 9:44pm UTC](https://www.ruby-forum.com/t/get-all-cookies-from-a-website/169794 "2009-06-08T21:44:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmcolli00](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@mmcolli00](https://www.ruby-forum.com/u/mmcolli00)\
**Post date:** [June 8, 2009, 9:44pm UTC](https://www.ruby-forum.com/t/get-all-cookies-from-a-website/169794/1 "2009-06-08T21:44:20Z")

</div>

Hi all  
Once I reach a website, I want to get a list of all the cookies for that  
page. When I run this, the ruby scripts just sits and does nothing. How  
do you get the cookie and values from a website using cgi gem? Thanks MC

#Once I login to my website, I run this script.

require ‘cgi’  
cgi = CGI.new  
#cookie = CGI::Cookie.new  
puts cgi.cookies  
end
