Deck 9: Managing State Information and Security
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Match between columns
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/41
Play
Full screen (f)
Deck 9: Managing State Information and Security
1
You can use special characters in your cookies if you use ____.
A) encoding
B) Unicode
C) strings
D) URIs
A) encoding
B) Unicode
C) strings
D) URIs
A
2
You use the ____ property of the Document object to create cookies in name-value pairs.
A) query
B) state
C) hidden
D) cookie
A) query
B) state
C) hidden
D) cookie
D
3
You create hidden form fields with the ____ element.
A) option
B) select
C) input
D) hidden
A) option
B) select
C) input
D) hidden
C
4
To create a query string, you add a ____ immediately after a URL, followed by the query string.
A) &
B) !
C) ?
D) %
A) &
B) !
C) ?
D) %
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
5
The built-in ____ function is used in JavaScript for encoding the individual parts of a URI.
A) encodeCookie()
B) encodeURLComponent()
C) encodeURIComponent()
D) encodeComponent()
A) encodeCookie()
B) encodeURLComponent()
C) encodeURIComponent()
D) encodeComponent()
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
6
The ____ attribute of the cookie property determines how long a cookie can remain on a client system before it is deleted.
A) path
B) expires
C) secure
D) domain
A) path
B) expires
C) secure
D) domain
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
7
The ____ attribute determines the availability of a cookie to other web pages on a server.
A) domain
B) secure
C) path
D) expires
A) domain
B) secure
C) path
D) expires
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
8
You can use a(n)____ to pass information, such as search criteria, from one web page to another.
A) text area
B) query string
C) label
D) image button
A) text area
B) query string
C) label
D) image button
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
9
The ____ property of the Location object contains a URL's query or search parameters.
A) query
B) arguments
C) parameters
D) search
A) query
B) arguments
C) parameters
D) search
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
10
____ cookies remain available only for the current browser session.
A) Persistent
B) Temporary
C) Local
D) Global
A) Persistent
B) Temporary
C) Local
D) Global
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
11
____ cookies remain available beyond the current browser session and are stored in a text file on a client computer.
A) Persistent
B) Global
C) Local
D) Temporary
A) Persistent
B) Global
C) Local
D) Temporary
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
12
A window, tab, or frame can view and modify the elements and properties of a document displayed in any other window, tab, or frame.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
13
HTTP was originally designed to be ____, which means that web browsers stored no persistent data about a visit to a website.
A) stateless
B) stateful
C) state-aware
D) state-active
A) stateless
B) stateful
C) state-aware
D) state-active
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
14
Cookies are stored on a user's computer as plain text files.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
15
For a web page to use the information in a query string, your JavaScript program must first parse the string.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
16
One way to preserve information following a user's visit to a web page is to append a query string to the end of a URL.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
17
You separate individual name-value pairs within a query string using ____.
A) %
B) &
C) $
D) ?
A) %
B) &
C) $
D) ?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
18
The most widespread way on the web today of storing state information on a user's computer is using ____.
A) cookies
B) scripts
C) hidden form fields
D) query strings
A) cookies
B) scripts
C) hidden form fields
D) query strings
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
19
The cookie property is created with a required ____ attribute.
A) value
B) path
C) name
D) expires
A) value
B) path
C) name
D) expires
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
20
The Web Storage API is supported by all browsers in use on the web today.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
21
__________ is a newer specification than cookies for storing state information on a user's computer.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
22
The ____ property of the Document object changes the origin of a document to its root domain name.
A) root
B) domain
C) environment
D) path
A) root
B) domain
C) environment
D) path
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
23
Match between columns
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
24
Information about individual visits to a website is called __________ information.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
25
What are the security areas of most concern to JavaScript programmers?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
26
Provide one reason for using the Web Storage API today, and one reason not to use it.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
27
What steps do you need to take to use special characters in your cookies?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
28
What are some of the reasons for maintaining state information?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
29
Describe the advantages and disadvantages of the original stateless design of the web.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
30
__________ are small pieces of information about a user that are stored in text files on a user's computer.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
31
To delete a cookie, you change the ____ property.
A) domain
B) expires
C) path
D) secure
A) domain
B) expires
C) path
D) secure
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
32
To use a cookie or other text string encoded with the encodeURIComponent()function, you must first decode it with the __________ function .
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
33
Describe how to extract all the contents of a query string except for the question mark.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
34
What limitations on the use of cookies are described in the cookie specification?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
35
Why should you delete persistent cookies that your program does not need?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
36
To extract the contents of a query string except for the question mark, you use the __________ method.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
37
____ refers to the writing of code in such a way that minimizes any intentional or accidental security issues.
A) Secure coding
B) Bulletproofing
C) Seal coding
D) Strong coding
A) Secure coding
B) Bulletproofing
C) Seal coding
D) Strong coding
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
38
The ____ attribute is used for sharing cookies across multiple servers in the same domain.
A) expires
B) domain
C) path
D) secure
A) expires
B) domain
C) path
D) secure
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
39
The ____ attribute indicates that a cookie can only be transmitted across a secure Internet connection using HTTPS or another security protocol.
A) domain
B) expires
C) path
D) secure
A) domain
B) expires
C) path
D) secure
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
40
Describe how to convert the individual pieces of information in a query string into array elements.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
41
Explain how to delete a cookie.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck