PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

An Introduction To PHP Sessions

What Should I Do To Destroy A Whole Session?

This is often used to log out of applications that store the login information in a session. You can use the code below to destroy your session completely.

Listing 10 listing-10.php
<?php
// Begin the session
session_start();
 
// Unset all of the session variables.
session_unset();
 
// Destroy the session.
session_destroy();
?>

In This Article