How can I write a logout output from a session in the same code? So that when I click on a picture, I’ll exit the session like unset and destroy (without using new file connections)

?session_start(); if ($_SESSION["Login"] != "YES") { include 'steam_auth.php'; } else { тут ваш код } 

    1 answer 1

    Enclose the picture in the link with the logout parameter

     <a href="/?logout=1"><img src="logout-img.gif" /></a> 

    Then write the condition in the code

     if ($_GET['logout']) { session_destroy(); } 

    When you click on the picture you get the desired effect.