The session_destroy function will not delete the PHPSESSID
, it will just remove the entire contents of the $_SESSION
variable. 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 rather at the next request.
If you want to clear all data from the $_SESSION
variable, just use session_reset . This function will erase all data from the above variable at the time it is run.
Particularly I see no reason to delete the value of PHPSESSID
since you can use the functions above or even unset .
But if you really want to remove this cookie, just use the setcookie a>.
setcookie(session_name(), null, 0);