The page Protecting Your Cookies: HttpOnly explains why making HttpOnly cookies is a good idea.
How do I set this property in Ruby on Rails?
Set the 'http_only' option in the hash used to set a cookie
e.g.
cookies["user_name"] = { :value => "david", :httponly => true }
or, in Rails 2:
cookies["user_name"] = { :value => "david", :http_only => true }