Learn to use sessions with Sinatra. Unlike cookies, sessions are built-in to Sinatra by default, but they must be enabled before you can use them. It is important to learn how to set a value which to use for session encryption to allow sessions to remain
- [Narrator] In this movie, we'll learn…how to use Sessions with Sinatra.…Sessions are very similar to cookies.…Sessions are typically used when we have…more information that we want to store about a user…and we also want to keep that information private,…something that the user shouldn't necessarily see…or know about or be able to inspect,…like they can with their cookies.…So we use Sessions in order to store that information.…The most common thing that you store in a Session…usually is someone's logged in state, right?…If we've logged in, now we know what user this person is,…we know that they've logged in successfully,…they knew the user name and password…so we want to store a value in their Session…so that we can identify them as they move…to different pages of our website.…
That's not the only use of Sessions…but it's by far and away the most common.…Unlike cookies, the Session code is…already built into Sinatra, we don't have to load up…a separate Ruby gem, it's already there,…we just have to say, enable sessions,…
- Installing Sinatra
- Launching the server
- Defining routes
- Using route patterns and parameters
- Redirecting requests
- Rendering dynamic templates
- Using partial templates and layouts
- Defining custom helpers
Skill Level Intermediate
Ruby on Rails 5 Essential Trainingwith Kevin Skoglund10h 21m Beginner
Ruby on Rails: Get More From ActiveRecordwith Kevin Skoglund4h 27m Intermediate
3. Helpers and Filters
4. Useful Techniques
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.