Skorpius

Session Function to list all available sessions

Jun 12th, 2022 (edited)
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.30 KB | None | 0 0
  1. //List all php sessions available
  2.    
  3.     function showSessions(){
  4.         echo "<h3> PHP List All Session Variables</h3>";
  5.         foreach ($_SESSION as $key=>$val)
  6.         echo $key.": ".$val."<br/>";
  7.     }
  8.  
  9. //To call the function - make sure to include/require functions.php page
  10.     showSessions();
Add Comment
Please, Sign In to add comment