From: Michael Linfield Date: 2009-03-15T05:48:05+09:00 Subject: Re: Fetching cookie??? Ok so you might do something like the following: #Change the directory to where your cookies are located #As an example I believe windows uses the following directory: Dir.chdir("C:/Documents and Settings/username/cookies") #not positive on this cookies = Dir.glob("*.txt") cookies.each do |file| info = File.readlines(file) #here is where you would put the code to manipulate the data #as you see fit. The name and content is in the info array. end Firefox is a bit different however; it stores all the cookie information in one text file. So instead of reading each file individually you would open that single file and use split to organize the data into an array. Dir.chdir("/home/user/.mozilla/firefox/x08923x.default") cookies = File.readlines("cookies.txt") *Note* there are much faster ways of reading a file but this only usually applies to very large files... File.readlines should be sufficient for what you're doing. Cheers! - Mac -- Posted via http://www.ruby-forum.com/.