Sail E0 Webinar

MCQs

Total Questions : 70 | Page 5 of 7 pages
Question 41. Which function is used to erase all session variables stored in the current session?
  1.    session_destroy()
  2.    session_change()
  3.    session_remove()
  4.    session_unset()
 Discuss Question
Answer: Option D. -> session_unset()
Question 42. What will the function session_id() return is no parameter is passed?
  1.    Current Session Identification Number
  2.    Previous Session Identification Number
  3.    Last Session Identification Number
  4.    Error
 Discuss Question
Answer: Option A. -> Current Session Identification Number
Question 43. Which one of the following statements should you use to set the session username to Nachi?
  1.    $SESSION[‘username’] = “Nachi”;
  2.    $_SESSION[‘username’] = “Nachi”;
  3.    session_start(“nachi”);
  4.    $SESSION_START[“username”] = “Nachi”;
 Discuss Question
Answer: Option B. -> $_SESSION[‘username’] = “Nachi”;
Question 44. What will be the output of the following PHP code? Say your previous session username was nachi.
  1.    Username now set to: nachi
  2.    Username now set to: System
  3.    Username now set to:
  4.    Error
 Discuss Question
Answer: Option C. -> Username now set to:
Question 45. An attacker somehow obtains an unsuspecting user’s SID and then using it to impersonate the user inorder to gain potentially sensitive information. This attack is known as.
  1.    session-fixation
  2.    session-fixing
  3.    session-hijack
  4.    session-copy
 Discuss Question
Answer: Option A. -> session-fixation
Question 46. Which parameter determines whether the old session file will also be deleted when the session ID is regenerated?
  1.    delete_old_file
  2.    delete_old_session
  3.    delete_old_session_file
  4.    delete_session_file
 Discuss Question
Answer: Option B. -> delete_old_session
Question 47. Which function effectively deletes all sessions that have expired?
  1.    session_delete()
  2.    session_destroy()
  3.    session_garbage_collect()
  4.    session_expired_delete()
 Discuss Question
Answer: Option C. -> session_garbage_collect()
Question 48. Which function is used to transform PHP’s session-handler behavior into that defined by your custom handler?
  1.    session_set_save()
  2.    session_set_save_handler()
  3.    Session_handler()
  4.    session_save_handler()
 Discuss Question
Answer: Option B. -> session_set_save_handler()
Question 49. The session_start() function must appear.
  1.    after the html tag
  2.    after the body tag
  3.    before the body tag
  4.    before the html tag
 Discuss Question
Answer: Option D. -> before the html tag
Question 50. What is the return type of session_set_save_handler() function?
  1.    boolean
  2.    integer
  3.    float
  4.    character
 Discuss Question
Answer: Option A. -> boolean

Latest Videos

Latest Test Papers