does `match` really throw exceptions? I think it only returns nil.

BTW: Please check res for `nil?` before calling `get_cookies`