When you write a cookie with an expiration date to a specific machine, the cookie is not set. This technique usually works with other computers.
The browser on the client's machine seems to otherwise work fine on most other websites, however, it is not working on this particular machine. You have checked that the time on the machine corresponds to the time on the server within a reasonable margin by verifying the date that is reported by the operating system on the client's machine.
Which of the following is the reason for this problem?
Assuming that the $action and $data variables are entered by a user and the register_globals directive is enabled. Is the following PHP code acceptable from a security standpoint:
<?php
if (isUserAdmin()) {
$isAdmin = true;
}
$data = validate_and_return_input($data);
switch ($action) {
case 'add':
addSomething($data);
break;
case 'delete':
if ($isAdmin) {
deleteSomething($data);
}
break;
case 'edit':
if ($isAdmin) {
editSomething($data);
}
break;
default:
print "Bad Action.";
}
?>