O'Reilly logo

Learning Rails: Live Edition by Edd Dumbill, Simon St. Laurent

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Test Your Knowledge

Quiz

  1. How much information should you store in cookies?

  2. How do you specify how long a cookie will last?

  3. Where does Rails normally store the information you put in the cookie object?

  4. What does calling flash.now do?

Answers

  1. You should store as little information in cookies as your application can manage.

  2. Cookie lifespans default to expiring when the user quits the browser, but can be set to more specific lengths of time with the :expires parameter.

  3. By default, Rails stores the cookie objects information directly in the cookie, on the user’s browser, but note that you can change this by modifying your config/environment.rb file.

  4. The flash.now method lets you set a value to be sent to the user, but ensures that the value will be cleared before any reloads or redirects.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required