If I execute:
die();
Will it also effectively call
session_write_close();
Because die stops the entire process?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No. As you can see on the PHP page: http://www.php.net/manual/en/function.exit.php (because die is equivalent to exit)
BUT, session_write_close is NOT a shutdown function. It will not run if you “die”. I suggest you look into session_register_shutdown. This will register session_write_close() as a shutdown function and in this case, it will run on “die”.
More Info: http://www.php.net/manual/en/function.session-register-shutdown.php