7 quizzes found.

To destroy one variable within a PHP session you should use which method in PHP 5?

  1. Unset the variable in $HTTP_SESSION_VARS
  2. Use the session_destroy() function
  3. Use the session_unset() function
  4. unset the variable in $_SESSION using unset()
  5. Any of the above are acceptable in PHP 5

Choose 1 answers

If you would like to store your session in the database, you would do which of the following?

  1. It requires a custom PHP extension to change the session handler
  2. Implement the session_set_save_handler() function
  3. Create functions for each session handling step and use session_set_save_handler() to override PHP's internal settings
  4. Configure the session.save_handler INI directive to your session class

Choose 1 answers

To destroy a PHP session completely, one must which of the following?

  1. Regenerate the session ID using session_regenerate_id()
  2. If cookies are used, destroy it
  3. Use session_demolish() to completely destroy the session
  4. Change the session name using session_name()
  5. Destroy the session data using session_destroy()

Choose 2 answers

If you would like to change the session ID generation function, which of the following is the best approach for PHP 5?

  1. Set the session.hash_function INI configuration directive
  2. Use the session_set_id_generator() function
  3. Set the session id by force using the session_id() function
  4. Use the session_regenerate_id() function
  5. Implement a custom session handler

Choose 1 answers

By default, PHP stores session data in ________________.

  1. The filesystem
  2. A database
  3. Virtual memory
  4. Shared memory
  5. None of the above

Choose 1 answers

The filesystem (Answer 1). By default, PHP stores all session information in the /tmp folder; users of operating systems where this folder doesn’t exist (such as Windows) must change the default value of the session.save_path php.ini setting to a directory appropriate for their setup (e.g.: C:\Temp).