This video covers the $_SESSION superglobal array in PHP as well as all the fundamentals of what sessions are, how they work in the browser and on the server.
The tutorial includes a simple example of creating a public and a private page with login and logout features.
public.php GIST: https://gist.github.com/prof3ssorSt3v...
private.php GIST: https://gist.github.com/prof3ssorSt3v...
session.php GIST: https://gist.github.com/prof3ssorSt3v...
login.php GIST: https://gist.github.com/prof3ssorSt3v...
logout.php GIST: https://gist.github.com/prof3ssorSt3v...