The function session_destroy will not delete the PHPSESSID
, will only remove all the contents of the variable $_SESSION
. This function does not remove the session cookie.
Just remembering that session_destroy
does not remove data from $_SESSION
at the time it was executed, but yes at the next request.
If you want to clear all variable data $_SESSION
, just use session_reset. This function will erase all data from the above variable at the time it is executed.
Particularly I see no reason to delete the value of PHPSESSID
since you can use the above functions or still unset.
But if you really want to remove this cookie, just use the function setcookie.
setcookie(session_name(), null, 0);
has tried to expire before the
unset();
– Leandro Angelo
Enter the code to see how you are performing
– Anderson Henrique