Answers for "can't destroy session php"

PHP
6

destroy session php

<?php 
 session_start(); // start session
 session_destroy();  // Delete whole session
// OR
unset($_SESSION['username']); // delete any specific session only
?>
Posted by: Guest on June-15-2020
0

php session destroy not working

//make sure you don't forget to initialize session before destroying it
session_start() ;
session_destroy();
$_SESSION = [];//and clear it for this request
Posted by: Guest on August-06-2021

Browse Popular Code Answers by Language