Everything About PHP Sessions (Udemy.com)
A complete course about handling persistent PHP sessions storing them into database securely and auto login system
Created by: Eric Azimi
Last updated October 2015
What you will learn
- Configure PHP sessions to make them persistent
- Inspect how session data is stored
- Implement persistent sessions
- Create a SQL database to store session data
- Implement the PHP SessionHandlerInterface
- Write session data
- Close and destroying sessions
- Create an auto-login system with persistent sessions
- Create persistent logins
- Checkout visitor credentials
- Authenticate users
- Log out users selectively
How it compares
Against the other 151 rated Udemy courses in PHP on CourseDuck:
- Rating4.0 out of 5higher than 8% of them
- Reviews39#142 of 152 by number of reviews
- Length3.7 hoursshorter than 64% of them
- Last updatedOctober 2015earlier than 95% of them
Quality Score
Overall Score : 80 / 100
Course Description
PHP tireless sessions allow for communication between the server and client. This allows web applications to remember the identities of visitors as well as any variables or other data. This practical and challenging project-based course will help developers take the data that PHP normally stores in plain text files and write them into a more secure database, where the records can be read and destroyed as needed. I help you set up a SQL database, define classes to open and close sessions, read and write variables, destroy sessions, and manage out-of-date records. The lessons culminate in a short project that uses tokens to recognize returning users in an auto-login scenario.
In this course:
- I'll show you how to store session in data in a MySQL database
- How to log in returning users automatically
- We'll begin with an overview of how PHP handles Sessions and stores session data in plain text files on the web server
- We'll set up a database to store session data more securely
- I'll show you how to define a class to open and close sessions
- Read and write session variables to the database
- Destroy sessions and garbage collect out-of-date records
Sessions expire as soon as soon as the browser is closed, but the highlight of this course is an auto-login system that uses a randomly generated single use token that recognizes returning users and preserves their data between visits, even on different computers. I hope you'll find this a useful and challenging project.
keeping the user's data always up to date with persistent sessions is extremely convenient. But, and I can't stress this strongly enough, persistent sessions are not 100 percent secure. When using sessions, you should always use a connection over secure sockets layer, or transport layer security whenever possible. I’m going to talk about why always re-authenticate user credentials before allowing allowing access to pages with sensitive content, such as changing user account details.
Instructor Details
- 4.0 Rating
39 Reviews
Eric Azimi
I am a software engineer and web developer with a passion for creating engaging and informative video tutorials about technology and programming. I hold a first-class Honours degree from one of London’s top universities and specialize in cutting-edge technologies related to software development, web development, and coding.
Over the years, I’ve developed proficiency in numerous programming languages, particularly web-based ones. My learning journey has been fueled by a love for practical, hands-on approaches—watching tutorials has always been more impactful for me than reading textbooks. That said, I have read extensively on computing and programming, complementing my video-based learning with in-depth books to broaden my knowledge.
My fascination with computers and programming drives me to approach challenges like puzzles, always aiming to build innovative solutions. Recognizing that many others, like myself, prefer learning through interactive, visual content, I decided to create high-quality video tutorials that make learning exciting, practical, and accessible.
More PHP courses
Projects in PHP and MySQL (2018)
4.8 (1,026 Reviews)
Provider: Udemy
Time: 19.8h
$11.99
Original priceBasic PHP Development with Bootstrap, GitHub and Heroku (2022)
4.8 (447 Reviews)
Provider: Udemy
Time: 4.8h
Free
Sending email with PHP: from Basic to Advanced (2026)
4.8 (297 Reviews)
Provider: Udemy
Time: 2.1h
$11.99
Original pricePHP for Beginners (2025)
4.7 (4,162 Reviews)
Provider: Udemy
Time: 14.2h
$11.99
Original priceWrite PHP Like a Pro: Build a PHP MVC Framework From Scratch (2026)
4.7 (3,332 Reviews)
Provider: Udemy
Time: 6.7h
$13.99
Original pricePHP Unit Testing with PHPUnit (2026)
4.7 (2,806 Reviews)
Provider: Udemy
Time: 2.8h
$10.99
Original price
Reviews
By Alfio Sauri on 7/20/2021
The course has the information I wanted. The instructor is knowledgeable but at times his explanations come short. However, the base knowledge is there, and he frequently makes reference to the sources to expand on any particular objective his is covering. P.S: I ran the video at 1.5 speed.
By Pavit Singh on 9/7/2020
The instructor doesn't explain the code very well, he does go over the lines and mentioning them but seldom he explains how the code is working. Also i found the exact same course on linkedIn learning it is a course made by David powers and that particular course has all the same materail and even the folder structure is same, that begs the question which the real one, which the fake ? the truth is out there but according to my brilliant deductions (sarcasm), I THINK THAT THIS COURSE IS JUST A POOR COPY( NOT SARCASM ).
By James Delancey on 4/13/2019
This is a fantastic course. I'm very happy that this course doesn't drag on for 100 hours typing code. People looking for a PHP primer should go do that first then come back and learn one way to do advanced sessions here. As for the content as advertised, the course covers the material well and the code that is included is well done.
By Richard Rowley on 1/9/2019
There are errors in the exercise files that make the project not work. I mentioned these to the instructor via the Q&A section for this course.
By Celia M Gaylard on 2/16/2018
I know nothing about php sessions and I was struggling with creating session but they were not "persistent" and my username kept "falling off". Thus far some of the information covered is assisting my greater understanding of sessions, their use and the security aspects and related configurations of which I knew nothing. I am very grateful for this knowledge.
By Chandrashekhar Gaikwad on 12/29/2017
The instructor did not write any code, just copy and paste every time. Need more explanation about code. I tried same code but did not work for me.
By Adolfo González on 6/13/2017
I watched the whole series in youtube, however they did not offer the files. I'm looking for a way to secure my logins as I currently do it the wrong way (storing everything in a cookie, yeah I know it's stupid now), gladly I found this site and found the course. So now I will be able to do it the right way and practice this step by step with the files shown in the videos to secure my users even before going into production mode :) Thank you! Update: After watching the whole tutorial... holly crap it's a lot to process! Now I have to digest all this information and put it in practice. Thank you for the tutorial again, will be using this for my current project as well as my new projects to protect users better.
By Matt on 10/8/2016
This course is very well done! The author is very knowledgeable on the subject and does a great job of explaining complex topics. Some of the code is above my current level of understanding (in PHP), but I still learned enough to create my own login and registration system. Thank you and looking forward to more courses!
By Markus Lommer on 9/4/2016
Nice, elaborate course on session handling. The testing setup was most helpful to recap the processes. However, some diagrams on the data and process flow would maybe enhance clearity.
By Mohammad Nizam Uddin on 11/13/2015
I was looking online for a course that can teach me about PHP sessions. I found very little resources that deals with PHP sessions in depth. But finally I have come to the right place. This course indeed solved my problem. Now I have a great understanding of PHP sessions. Thanks Azimi for this great course.
By m mazraeshahi
tnx
is good
By Jorge Francisco Vera Mosquera
Muy didáctico






