Building Database Applications in PHP Week 3 Practice Quiz Answer
Building Database Applications in PHP
Week 3 Practice Quiz Answer
How does a web server recognize a particular web browser?
- Web link
- None of these
The Web is a stateful system.
The browser does not always maintain a connection to the server.
Cookies can be made to last for how long?
- Till the session ends
- Any of these
If a browser is contacting a server for the very first time, the browser does not send cookies in its first request.
Sessions are server controlled and are protected from the users direct access to it.
session_start() is used to
- Relocate a session
- Restore an old session
- Rename a session
- Make a new session
session_start() can be placed anywhere in the php file.
The [_____] function is used to remove a session.
$_SESSION is a
- Associative array
- All of these
- Super global variable
- Variable that stores session details
PHP applications can make changes to the $_SESSION variable.
End users can make changes to the $_SESSION variable.
Generally, if there are no cookies for a web site in the browser, PHP will make a new session as soon as the user tries to access the url.
When do session cookies expire?
- After two hours
- After the expire date passes
- When the browser is closed
- After the user closes a tab on their browser
- After 24 hours
Where are non-session cookies stored?
- In the cloud on a separate memcached server
- On the hard drive of the PHP server
- In the database on the server
- On the hard drive of the user’s computer
- In the memory of the PHP server
What is the typical session identifier?
- A large random number chosen by the server
- The MD5 hash of the user’s email address
- The MD5 hash of the domain name of the server
- A large random number chosen by the browser
- The number of seconds since January 1, 1970
If a browser does not support cookies, how can PHP maintain a session?
- By including the session identifier as a parameter every GET and POST request
- By using an MD5 hash of the user’s email address as the session identifier
- By using the “secure cookie” header to force the browser to set a cookie
- By using the browser’s network address as the session identifier