Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Sessions and Flash


Published on

A Rails talk for Dev Bootcamp

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Sessions and Flash

  1. 1. SESSIONS AND FLASH What goes in a hash?
  2. 2. REVIEW: WHAT IS A SESSION? A session is a hash that will store information on the client’s server until the session times out or is deleted. Ex: creating a new session at login to remember a user until they log out or exit the application.
  3. 3. FUN FACTS ➤ Sessions are “lazily loaded”, meaning they will only load if you use them. If you choose not to use sessions, you don’t have to disable them. ➤ You can use the reset_session method to reset the entire session hash. ➤ To store data that persists from session to session, you can store a session in the CookieStore.
  4. 4. WHAT IS THE FLASH HASH? Much like a session, a flash is a bit of information that is stored on the client’s server. A flash will only last from one request to the next.
  5. 5. MORE ABOUT FLASH ➤ You can create different types of messages, such as :notice or :alert. ➤ You can also create custom alerts such as: ➤ To display multiple flash messages, iterate through the hash using each.
  6. 6. OTHER WAYS TO USE FLASH flash.keep
  7. 7. FUN FACT ➤ Bootstrap has alert classes that can be used to display flash messages.