You do not need to change anything for Geroku. By default, Rails sessions are stored in an encrypted cookie, so server side configuration is not required.
However, a cookie can only store 4,096 bytes of data. If you store a lot of data in a session (which is usually not recommended), you can overflow the cookie. In this case, you can set ActiveRecord or Memcached cookies. Both are easy to use, and are not really specific to Heroka. If you need help with this, you can always ask another StackOverflow question. So far this does not bother you until you reach the limit.
Incorrect code to store and read your answers in a session, assuming questions and answers are ActiveRecord models:
def store_answer(question, answer) session[:answers] ||= {} session[:answers][question.id] = answer.id end def read_answer(question) Answer.find(session[:answers][question.id]) end
wuputah
source share