A session provides a way to make variables accessible across multiple web pages. Unlike cookies, session data is stored on the server.
Starting a Session
To begin a session, the session_start function is used. This function must appear before any output is sent to the web page.
<?php session_start(); ?>
The session_start function sets a cookie on the client’s computer, containing an id used to associate the client with the session. If the client already has an ongoing session, the function resumes that session instead of starting a new one.
Session Array
With the session started, the $_SESSION array is used ...