OK, so there are apparently a few ways to end sessions or delete session data, and I'm having trouble finding a simple explanation of what the difference is between them. Here's an example of each method I've seen:
How is each method different? Which should you use when? Which method(s) do you personally prefer to use and why?Code:<?php unset($_SESSION); // method one $_SESSION = array(); // method two session_destroy(); // method three setcookie(session_name(), "", time()-3600); // method four ?>
Thanks for your help!