Class: HTTPal::CookieMonster

Inherits:
Object
  • Object
show all
Defined in:
lib/rspider/cookie.rb

Class Method Summary collapse

Class Method Details



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/rspider/cookie.rb', line 13

def self.parse_set_cookie(sc)
	r = []
	# need to figure out how to do the multi-cookie split
	# since the comma separates both cookies and dates

	# TODO: IMPLEMENT A LESS BAD SOLUTION
	sc = sc.gsub(/expires=(\w\w\w)\,/,'expires=\1')

	sc.split(',').each do |str|
		str.chomp!
		r << Cookie.new(str)
	end
	return r
end