What is the difference and most secure way to clear login sessions in PHP
? Basically going to call this when a user clicks log out
in my application.
I am seeing:
session_destroy()
session_unset()
Or simply doing:
unset($_SESSION['my_key_1']);
unset($_SESSION['my_key_2']);
What is the best way?
log out
, I need to clear sessions completely.