MCQs > IT & Programming > PHP > When user clicks on Logout link, the user is redirected to logout.php file and the file has following code? What is wrong with the following code?

PHP MCQs

When user clicks on Logout link, the user is redirected to logout.php file and the file has following code? <?php session_unset(); session_destroy(); header("Location: index.php"); ?> What is wrong with the following code?

Answer

Correct Answer: The first line of the file should be session_start() so that session_destroy() will destroy the active session.

Explanation:

Note: This Question is unanswered, help us to find answer for this one

PHP Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

PHP Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it