PHP

PHP

Session Handling has 19 Questions
Which function effectively deletes all sessions that have expired?

session_delete()
session_destroy()
session_garbage_collect()
session_expired_delete()
Which function is used to transform PHP's session-handler behavior into that defined by your custom handler?

session_set_save()
session_set_save_handler()
Session_handler()
session_save_handler()
The session_start() function must appear..

after the html tag
after the body tag
before the body tag
before the html tag
What is the return type of session_set_save_handler() function?

boolean
integer
float
character
Which one of the following is the very first task executed by a session enabled page?

Delete the previous session
Start a new session
Check whether a valid session exists
Handle the session
How many ways can a session data be stored?

3
4
5
6
Which directive determines how the session information will be stored?

save_data
session.save
session.save_data
session.save_handler
Which one of the following is the default PHP session name?

PHPSESSID
PHPSESID
PHPSESSIONID
PHPIDSESS
If session.use_cookie is set to 0, this results in use of..

Session
Cookie
URL rewriting
Nothing happens
If the directive session.cookie_lifetime is set to 3600, the cookie will live until..

3600 sec
3600 min
3600 hrs
the browser is restarted
Neglecting to set which of the following cookie will result in the cookie's domain being set to the host name of the server which generated it.

session.domain
session.path
session.cookie_path
session.cookie_domain
What is the default number of seconds that cached session pages are made available before the new pages are created?

360
180
3600
1800
What is the default time(in seconds) for which session data is considered valid?

1800
3600
1440
1540
Which one of the following function is used to start a session?

start_session()
session_start()
session_begin()
begin_session()
Which function is used to erase all session variables stored in the current session?

session_destroy()
session_change()
session_remove()
session_unset()
What will the function session_id() return is no parameter is passed?

Current Session Identification Number
Previous Session Identification Number
Last Session Identification Number
Error
Which one of the following statements should you use to set the session username to Nachi?

$SESSION['username'] = "Nachi"?;
$_SESSION['username'] = "Nachi"?;
session_start("nachi"?);
$SESSION_START["username"?] = "Nachi"?;
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..

session-fixation
session-fixing
session-hijack
session-copy
Which parameter determines whether the old session file will also be deleted when the session ID is regenerated?

delete_old_file
delete_old_session
delete_old_session_file
delete_session_file