Learn the fundamentals of working with sessions in PHP and discover how sessions are different from cookies.
- [Narrator] In this movie,…we're going to learn about sessions.…Sessions solve a similar problem to cookies,…but they do it in a different way,…and they have different strengths and weaknesses.…So let's talk about how we work with sessions in PHP.…When we're going to work with sessions,…the way the process works is that we're going…to store data in a session file.…That's going to be a file that's on the web server.…We're not sending the data off to the user…for them to put in a cookie.…Instead, what we're going to do is send…a reference identifier for that session file…to the user as a cookie.…
So the user still gets a cookie,…but they don't get actual data.…What they get is a reference identifier…for a file that sits on the web server.…And then PHP will handle the retrieval of that session file.…It'll take the cookie data.…It'll see the reference identifier.…It'll go to the file system, find the file, open it up,…and get the values that are in the session…out of there ready for us to use.…So why do it this way?…
- Creating a content management system
- Building dynamic content navigation
- Using context and function options for conditional behavior
- Hiding content from the public view
- Insecure direct object reference
- Allowing HTML in dynamic content
- Previewing content in the public context
- Working with cookies and sessions
- Storing status messages in the session
- Secure user authentication (login/logout)
- Regulating page access
- Nesting related resources
- Managing an ordered list automatically
Skill Level Beginner
PHP with MySQL Beyond the Basicswith Kevin Skoglund10h 26m Intermediate
MVC Frameworks for Building PHP Web Applicationswith Drew Falkman2h 57m Intermediate
1. Create a Content Management System
2. Build Dynamic Content Navigation
3. Use Context and Options
4. Cookies and Sessions
5. Regulate Page Access
6. Nesting Related Resources
Next steps1m 15s
- 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.