Sessions automatically end when the PHP script finishes executing but can be manually ended using the session_write_close(). Post navigation What is the meaning of a Persistent Cookie? What is the difference between session_unregister() and session_unset()?