Utilizor
Contact Us

PHP Sessions

Managing sessions.

PHP Sessions

A session is a way to store information (in variables) to be used across multiple pages.

Unlike a cookie, the information is not stored on the users computer.

Start a PHP Session

A session is started with the session_start() function.

Session variables are set with the PHP global variable: $_SESSION.

Destroy a PHP Session

To remove all global session variables and destroy the session, use session_unset() and session_destroy().