Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

CSCI 2910 PHP Sessions and Security Quiz Answers and Explanations - Prof. David L. Tarnoff, Quizzes of Computer Science

A quiz about php sessions and security. It includes questions about session tracking, session functions, session variables, superglobal variables, and security threats. It also covers encryption functions and preventing malicious database access.

Typology: Quizzes

Pre 2010

Uploaded on 08/19/2009

koofers-user-hix
koofers-user-hix 🇺🇸

10 documents

1 / 2

Toggle sidebar

Related documents


Partial preview of the text

Download CSCI 2910 PHP Sessions and Security Quiz Answers and Explanations - Prof. David L. Tarnoff and more Quizzes Computer Science in PDF only on Docsity! CSCI 2910 PHP Sessions and Security Quiz Name: ________________________________ Spring 2007 1. For lower traffic sites, sessions can be kept track of with a text file. High traffic sites, however, should use a(n) ________________ to keep track of sessions. (1 point) 2. To start a new session explicitly, the function ____________ should be called. (1 point) a.) session_start() b.) get_session() c.) new Session() d.) find_session() e.) session_open() 3. To open an existing session, the function ____________ should be called. (1 point) a.) session_start() b.) get_session() c.) new Session() d.) find_session() e.) session_open() Questions 4 and 5 are based on the following 'snippet' of PHP code. Note that the numbers on the left have been added as a reference to line numbers and are not part of the code. 1: if(!isset($_SESSION['count'])) 2: { 3: $_SESSION['count'] = 0; 4: $_SESSION['name'] = $_POST['user_name']; 5: } 6: $_SESSION['count']++; 4. What condition causes the returned value of isset() in line 1 to be false? (2 points) 5. If this piece of code is accessed 25 times during a client's session, how often was line 6 executed for this client? (1 point) a.) never b.) one time c.) 24 times d.) 25 times 6. True or False: A session variable can be of any type or object (1 point) 7. There are two ways to remove session variables. One is to remove them individually using unset(). The second method is to remove them all at once. How is the second one achieved? (2 points) 8. Define only two of the following three superglobal variables. (4 points) $_SERVER['HTTP_REFERER']: $_SERVER['REQUEST_METHOD']: $_SERVER['REMOTE_ADDR']:
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved