Proposing SQL Statement Coverage Metrics: Difference between revisions
Programsam (talk | contribs) |
Programsam (talk | contribs) |
||
| Line 38: | Line 38: | ||
Usernames typically consist of alphanumeric characters, underscores, periods and dashes. Passwords also typically consist of these character ranges and additionally allow for some other non-alphanumeric characters such as $, ^ or #. The authentication mechanism functions by a code segment resembling the one in Figure 4. Assume there exists some table maintaining a list of all usernames, passwords, and most likely some indication of the role of each unique username. | Usernames typically consist of alphanumeric characters, underscores, periods and dashes. Passwords also typically consist of these character ranges and additionally allow for some other non-alphanumeric characters such as $, ^ or #. The authentication mechanism functions by a code segment resembling the one in Figure 4. Assume there exists some table maintaining a list of all usernames, passwords, and most likely some indication of the role of each unique username. | ||
//for simplicity, this example is given in PHP. | //for simplicity, this example is given in PHP. | ||
//first, extract the input values from the form | //first, extract the input values from the form | ||
| Line 53: | Line 52: | ||
//set a cookie for the user with their role | //set a cookie for the user with their role | ||
setcookie(“userrole”, $role); | setcookie(“userrole”, $role); | ||
<center>'''Figure 4. Example authentication code'''</center> | <center>'''Figure 4. Example authentication code'''</center> | ||