Sessions, Carrying data around with you

Very often, you'll find you need to keep up with data you've gathered about a visitor to your site. Whether this be part of a request or response form, or just things they've seen and done while they were here. Php allows you to create what is commonly called a session. A session is a sequence of visits to a website. They last as long or as little as you wish. They also make it so much easier to work with multi-page web forms.

The complete documentation is documented on the official php.net website, in PHP Session handling functions. We will be assuming you're using PHP 4.06 or later.

Sessions are either started automatically, or by calling session_start(). Once the session exists, you can read and set session variables through the $_SESSION convention.