Deck 9: Managing State Information
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/83
Play
Full screen (f)
Deck 9: Managing State Information
1
A hidden form field is not displayed by the browser.
True
2
Each individual server or domain can store between 20 and 70 cookies on a user's computer.
True
3
You can use a query string to pass information from one Web page to another.
True
4
The setcookie() function can be called only once.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
5
The $_REQUEST[] autoglobal is always good choice to use as it contains all of the array elements of the $_GET[], $_POST[], and $_COOKIE autoglobal arrays.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
6
Users can choose whether to accept cookies that a script attempts to write to their system.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
7
Since cookies must be set individually, they cannot be stored in arrays.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
8
Cookies were originally created for use with CGI scripts.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
9
You can call the setcookie() function at any location in your Web page.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
10
To make it possible to store state information beyond a current Web page session, Microsoft invented cookies.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
11
Cookies are stored in a binary file on the user's computer.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
12
Maintaining state refers to storing persistent data about a Web site visit using hidden form fields, query strings, cookies and sessions.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
13
Hidden input elements are visible in the URL when you use the get method but are not visible in the source code of the Web page.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
14
You can access any query string data that is appended to a URL from PHP by using the $_POST autoglobal.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
15
Query strings permanently maintain state information.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
16
Persistent cookies remain available only for the current browser session.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
17
Hidden form fields maintain state information between Web pages, but not when the Web session closes.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
18
Cookies created with the name and value arguments are temporary cookies.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
19
The setcookie() function has no required arguments.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
20
You cannot append a query string to any URL on a Web page.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
21
One way to preserve information following a user's visit to a Web page is to append a ____ at the end of a URL.
A) function
B) query string
C) auto-global
D) indentifier
A) function
B) query string
C) auto-global
D) indentifier
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
22
How many name=value pairs are in the following URL?
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
23
For a cookie to persist beyond the current browser session you must use the terminate argument with the setcookie() function.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
24
You separate individual name=value pairs within a query string using ____.
A) ampersands (&)
B) backslashes (\)
C) question marks (?)
D) forward slashes (/)
A) ampersands (&)
B) backslashes (\)
C) question marks (?)
D) forward slashes (/)
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
25
You do not need to delete persistent cookies because they automatically cease to exist when the current browser session ends.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
26
You use the path argument to share cookies across multiple servers in the same domain.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
27
In URL encoded format, each space character is represented by %20.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
28
Session state information is stored in the $_SESSION autoglobal.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
29
Encoding does not occur for standard alphanumeric characters.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
30
By default, a cookie is not available to all Web pages in the same directory.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
31
You create a cookie by passing to the setcookie() function a required ____ argument and five optional arguments.
A) name
B) value
C) expires
D) path
A) name
B) value
C) expires
D) path
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
32
By default, cookies cannot contain semicolons.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
33
Cookies can be temporary or ____.
A) persistent
B) relational
C) invisible
D) hidden
A) persistent
B) relational
C) invisible
D) hidden
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
34
You can use special characters in cookies created in PHP.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
35
The session_start() function does not accept any arguments.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
36
To pass information from one page to another using a query string, you add a(n) ____ immediately after the URL, followed by the query string containing the information you want to preserve in name=value pairs.
A) ampersand (&)
B) backslash (\)
C) question mark (?)
D) forward slash (/)
A) ampersand (&)
B) backslash (\)
C) question mark (?)
D) forward slash (/)
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
37
Whenever a Web client visits a Web server, saved ____ for the requested Web page are sent from the client to the server.
A) forms
B) fields
C) cookies
D) identifiers
A) forms
B) fields
C) cookies
D) identifiers
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
38
Which of the following is not a tool for maintaining state information with PHP?
A) hidden form fields
B) query strings
C) functions
D) cookies
A) hidden form fields
B) query strings
C) functions
D) cookies
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
39
You can access the values submitted from the form by using the $_GET[] and ____ autoglobals.
A) $_POST[]
B) $_FIND[]
C) $_RETRIEVE[]
D) $_SEND[]
A) $_POST[]
B) $_FIND[]
C) $_RETRIEVE[]
D) $_SEND[]
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
40
Web browsers can limit the total number of cookies stored on a user's computer to at least ____.
A) 200
B) 300
C) 400
D) 500
A) 200
B) 300
C) 400
D) 500
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
41
You store session state information in the $_SESSION ____.
A) script
B) function
C) autoglobal
D) cookie
A) script
B) function
C) autoglobal
D) cookie
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
42
If you want to store state information that will be available when a client revisits your Web site in the future, you must use ____.
A) sessions
B) cookies
C) autoglobals
D) hidden form fields
A) sessions
B) cookies
C) autoglobals
D) hidden form fields
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
43
You create hidden form fields with the ____________________ element.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
44
If a Web site stores no persistent data about a visit to a Web site, it is said to be ____________________.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
45
Whenever you need to work with sessions in a PHP script, you must call the ____ function.
A) set_cookie()
B) session_start()
C) keyword()
D) session_stop()
A) set_cookie()
B) session_start()
C) keyword()
D) session_stop()
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
46
Cookies that are available to the current Web page are automatically assigned to the ____ autoglobal.
A) $_GET
B) $_POST
C) $_COOKIE
D) $_FIND
A) $_GET
B) $_POST
C) $_COOKIE
D) $_FIND
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
47
What is the hexadecimal ASCII equivalent of a space character?
A) 19
B) 20
C) 22
D) 25
A) 19
B) 20
C) 22
D) 25
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
48
Which of the following characters would encoding not encode?
A) ,
B) /
C) %
D) ^
A) ,
B) /
C) %
D) ^
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
49
The ____ argument determines the availability of a cookie to other Web pages on a server.
A) secure
B) expires
C) path
D) domain
A) secure
B) expires
C) path
D) domain
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
50
The ____ argument indicates that a cookie can only be transmitted across a secure Internet connection using HTTPS or another security protocol.
A) secure
B) expires
C) domain
D) path
A) secure
B) expires
C) domain
D) path
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
51
PHP allows you to store cookie values in indexed or associative ____.
A) functions
B) text files
C) arrays
D) scripts
A) functions
B) text files
C) arrays
D) scripts
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
52
Information about individual visits to a Web site is called ____________________.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
53
____ are random alphanumeric strings that identifies a session.
A) Cookies
B) Functions
C) Session IDs
D) Hidden form fields
A) Cookies
B) Functions
C) Session IDs
D) Hidden form fields
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
54
For a cookie to persist beyond the current browser session, you must use the ____ argument with the setcookie() function.
A) secure
B) expires
C) path
D) domain
A) secure
B) expires
C) path
D) domain
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
55
Session state information is stored in the ____ autoglobal.
A) $_GET[]
B) $_POST[]
C) $_SESSION[]
D) $_COOKIE[]
A) $_GET[]
B) $_POST[]
C) $_SESSION[]
D) $_COOKIE[]
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
56
The ____ argument is used for sharing cookies across multiple servers in the same domain.
A) secure
B) domain
C) expires
D) path
A) secure
B) domain
C) expires
D) path
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
57
With a hidden form field you can only include the name and ____________________ attributes.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
58
To set the expire date of a persistent cookie, use PHP's ____ function and add to it an integer in seconds to specify when the cookie should be deleted.
A) date()
B) expire()
C) time()
D) day()
A) date()
B) expire()
C) time()
D) day()
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
59
A query string is a set of name=value pairs appended to the end of a ____________________.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
60
Omitting which of the following from the setcookie() function is equivalent creating a non-existent cookie?
A) name
B) value
C) expires
D) path
A) name
B) value
C) expires
D) path
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
61
____________________ are small pieces of information about a user that are stored by a Web server in text files on the user's computer.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
62
A cookie is of no use if you do not specify the _______________ argument.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
63
The ____________________ function converts special characters in a text string to their corresponding hexadecimal ASCII value.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
64
The ____________________ function is used to return the current date and time as a formatted string.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
65
In many programming languages, cookies cannot include special characters because they are transmitted between Web browsers and servers using ____________________.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
66
____________________ cookies remain available only for the current browser session.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
67
If a client's Web browser is configured to accept cookies, the session ID is assigned to a temporary cookie named ____________________.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
68
You use the ____________________ function to create cookies in PHP.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
69
The ____________________ argument determines the availability of a cookie to other Web pages on the server.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
70
A(n) ____________________ string consists of a single text string containing one or more pieces of information.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
71
You must call the ____________________ function whenever you need to work with sessions in a PHP script.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
72
You can use the ____________________ function to ensure that a cookie is set before you attempt to use it.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
73
Use PHP's ____________________ function to return the current time and add to it an integer in seconds to specify the time to delete the cookie.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
74
The term ____________________ refers to a period of activity when a PHP script stores state information on a Web server.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
75
To make a cookie available to all directories, use a(n) ____________________ to indicate the root directory.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
76
The ____________________ argument determines how long a cookie can remain on a client system before it is deleted.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
77
A(n) ____________________ is a random alphanumeric string generated by the session_start() function.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
78
To protect private data transferred across the Internet, Netscape developed _________________________ (SSL) to encrypt data and transfer it across a secure connection.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
79
The largest allowable cookie size is ____________________ kilobytes.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
80
Persistent ____________________ remain available beyond the current browser session.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck