-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.php
More file actions
40 lines (38 loc) · 1.48 KB
/
Copy pathtest.php
File metadata and controls
40 lines (38 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
echo "this is only a test<br>";
// compute the cookie for the current minute and display an authent error if the cookie presented by the client is older
$get2ExpectedCookie = "get2cookie" . date('Y-m-d_H-i');
$get3ExpectedCookie = "get3cookie" . date('Y-m-d_H-i');
$postExpectedCookie = "postcookie" . date('Y-m-d_H-i');
$get2FoundCookie ="";
$get3FoundCookie ="";
$postFoundCookie ="";
if (isset($_COOKIE['get2cookie'])) {
$get2FoundCookie = $_COOKIE['get2cookie'];
error_log("test.php: get2cookie=$get2FoundCookie");
}
else{
error_log("test.php: get2cookie not set");
}
if (isset($_COOKIE['get3cookie'])) {
$get3FoundCookie = $_COOKIE['get3cookie'];
error_log("test.php: get3FoundCookie=$get3FoundCookie");
}
else{
error_log("test.php: get3cookie not set");
}
if (isset($_COOKIE['postcookie'])) {
$postFoundCookie = $_COOKIE['postcookie'];
error_log("test.php: postcookie=$postFoundCookie");
}
else{
error_log("test.php: postcookie not set");
}
if ($get2ExpectedCookie !== $get2FoundCookie || $get3ExpectedCookie !== $get3FoundCookie || $postExpectedCookie !== $postFoundCookie){
echo "Authentification error<br>";
echo "Expected: <br>";
echo " $get2ExpectedCookie $get3ExpectedCookie $postExpectedCookie<br>";
echo "Found: <br>";
echo " $get2FoundCookie $get3FoundCookie $postFoundCookie<br>";
}
?>