Logging Out of a Session in PHP

An authorized user should have the ability to become unauthorized, that is, to perform a logout from their account. To do this, you need to create a separate page and remove the authorization mark on it, approximately like this:

logout.php<?php
  session_start();
  $_SESSION['auth'] = null;
?>
Задание 1

Implement the page logout.php. Upon visiting it, the user should no longer be authorized.

Задание 2

Modify the previous task so that the page logout.php, after executing its code, performs a redirect to index.php. Show a message on that page stating that the user is no longer authorized.