1.

Which function is used to erase all session variables stored in the current session?(a) session_destroy()(b) session_change()(c) session_remove()(d) session_unset()This question was posed to me during an interview.This interesting question is from Session Handling-2 in portion File and Session Handling in PHP of PHP

Answer»

Correct ANSWER is (d) session_unset()

The best explanation: The function session_unset() FREES all session VARIABLES that is currently registered. This will not completely remove the session from the STORAGE MECHANISM. If you want to completely destroy the session, you need to use the function session_destroy().



Discussion

No Comment Found

Related InterviewSolutions