Code Prostitute

the sordid details of my career as a code prostitute

Archive for October 2009

undefined method `set_cookie’ 2.3.3

leave a comment »

If you’re using “Tamper-proof cookies” like I am following this tutorial,
and recently moved to rails 2.3.3, you may be getting this error:

NoMethodError (undefined method `set_cookie’ for #):

It actually isn’t so much to do with Tamper-proof cookies, as it is that set_cookie has been deprecated in favor or http_only=.

So, if you’re having this issue, open lib/tamper_proof_cookie_jar.rb and search for “set_cookie” (should be line 38).

replace with this:

http_only=options

Or, anywhere you were using set_cookie, use http_only= instead.

Restart your app server (apache, mod_rails, mongrel…) and it should work for you now.

Written by codeprostitute

October 14, 2009 at 12:39 pm

Posted in Rails, Ruby

Tagged with , , ,