Web Application Development MCQs with Answers
Practice important Web Application Development MCQs with answers and explanations.
Multiple Choice Questions
Q91: Fill in the blank: The session_start() function must be the _______ thing in your PHP document.
- A: first
- B: last
- C: middle
- D: optional
View Answer
A
Q92: What is the purpose of the session_unset() function in PHP?
- A: To remove all session variables
- B: To destroy the session
- C: To set new session variables
- D: To start a new session
View Answer
A
Q93: Fill in the blank: The session_destroy() function is used to _______ the session.
- A: remove all global session variables
- B: modify session variables
- C: create a new session
- D: retrieve session information
View Answer
A
Q94: What does the session_start() function do?
- A: Initializes a new session or resumes an existing one
- B: Ends a session
- C: Deletes all session variables
- D: Sets session cookies
View Answer
A
Q95: What will happen if session_start() is not the first thing in your document?
- A: It will cause an error
- B: It will initialize a new session
- C: It will retrieve session variables
- D: It will destroy the existing session
View Answer
A
Q96: Fill in the blank: When a session is opened, PHP looks for a _______ to access the existing session.
- A: user-key
- B: session-file
- C: session-cookie
- D: database record
View Answer
A
Q97: What function is used to print all session variables for debugging?
- A: print_r($_SESSION)
- B: debug_session()
- C: show_session()
- D: list_session()
View Answer
A
Q98: Fill in the blank: To ensure session variables are available on multiple pages, they must be set using _______.
- A: $_SESSION
- B: session_set()
- C: session_value()
- D: global_session()
View Answer
A
Q99: What will be the effect of session_destroy() if used without session_unset()?
- A: Session variables will be removed but session will remain
- B: Session variables will be retained
- C: Only the session cookie will be deleted
- D: Nothing will happen
View Answer
A
Q100: Fill in the blank: To modify session variables, you simply _______ them using the $_SESSION global variable.
- A: reassign
- B: delete
- C: list
- D: print
View Answer
A