Section 1

Preview this deck

The availability of a cookie to other Web pages on a server is determined by the _____ argument of the setcookie() function

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (20)

Section 1

(20 cards)

The availability of a cookie to other Web pages on a server is determined by the _____ argument of the setcookie() function

Front

path

Back

Explain how to pass a session ID to other PHP scripts when cookies are not available.

Front

Store the session ID as a query string or hidden form field using the name/value pair "PHPSESSID=id" and access this value using the function session_id().

Back

Unlike the setcookie() function, you can call the session_start() function from any location on a Web page. True or false?

Front

False

Back

Stored information about a previous visit to a Web site is called ________ information.

Front

state

Back

Explain how query string data that is appended to a URL is retrieved in PHP.

Front

Anything appended to the end of a URL in the form of "name1=value1&name2=value2" can be accessed by using the $_GET[] autoglobal.

Back

How do you delete cookies before the time assigned to the setcookie() function's expiers argument elapses?

Front

Set the value to an empty string and assign a new expiration value to a time in the past.

Back

You use the _____ to read cookies in PHP.

Front

$_COOKIE[] autoglobal

Back

By default, cookies created without the expires argument of the setcookie() function are available for 24 hours. True or false?

Front

False; it is available until the user closes that browser session

Back

What is the name of the cookie that PHP creates for a session?

Front

PHPSESSID

Back

Describe the different types of information about a user that a Web server might need to store.

Front

A web server might need to store information about a user's identity under a user ID in order to display a customized version of the site. Depending on the type of site, specific information like the user's birthday, their previous purchases for a store site, or employee hours for payroll may all be stored in a database.

Back

You use the _____ to access session variables in PHP.

Front

$_SESSION[] autoglobal

Back

Explain how to use form fields to temporarily store user information.

Front

Create a hidden form field with a value of whatever data you want to store. By using the $_GET[] or $_POST[] PHP autoglobals, you can access the values in those hidden forms.

Back

Cookies created without the expires argument of the setcookie() function are called _____.

Front

temporary

Back

Which argument of the setcookie() function is used for sharing cookies outside of a domain?

Front

domain

Back

Which of the following examples specifies that a cookie should expire in three days?

Front

time()+606024*3

Back

You must manually encode and decode cookie values. True or false?

Front

False

Back

What is the correct syntax for creating a temporary cookie that contains a value of "blue"?

Front

setcookie("color", "blue");

Back

In what format are items in a query string appended to a target URL?

Front

as name/value pairs

Back

Explain the security risks involved with cookies and how sessions offer a more secure method of maintaining state.

Front

Cookies are saved on the client computer, so the security of the information stored in a cookie cannot be controlled by you on the server side. If the client's computer is not protected, then all of their cookie information is vulnerable to hackers. Sessions are a more secure way of temporarily saving information, because session data is saved on the PHP server, not the client computer. As long as the server is secure, the information is secure.

Back

HTTP was originally designed to store data about individual visits to a Web site. True or false?

Front

False

Back