When doing functional test, sooner or later you will need to do some testing with cookie, for example when you need to test the infamous ‘Remember me’ functionality. It is easy to do that in Rails with some points to take note: To set a cookie in a request: @request.cookies['name'] = CGI::Cookie.new('name', 'cookie value') To retrieve a cookie after a response: cookies['name']Note: Use a string