mirror of
https://gitlab.com/harald.mueller/aktuelle.kurse.git
synced 2024-11-24 18:51:56 +01:00
41 lines
942 B
PHP
41 lines
942 B
PHP
|
<?php
|
||
|
if (isset($_GET["test"])) {
|
||
|
$temp = array_key_exists("CookieTemp",
|
||
|
$_COOKIE);
|
||
|
$perm = array_key_exists("CookiePerm",
|
||
|
$_COOKIE);
|
||
|
setcookie("CookieTemp", "", 0);
|
||
|
setcookie("CookiePerm", "", 0);
|
||
|
} else {
|
||
|
setcookie("CookieTemp", "ok");
|
||
|
setcookie("CookiePerm", "ok", time() + 60*60*24);
|
||
|
}
|
||
|
?>
|
||
|
<html>
|
||
|
<head>
|
||
|
<title>Cookies</title>
|
||
|
<?php
|
||
|
if (!isset($_GET["test"])) {
|
||
|
echo "<meta http-equiv=\"refresh\" " .
|
||
|
"content=\"0;url=" .
|
||
|
htmlspecialchars($_SERVER["PHP_SELF"]) .
|
||
|
"?test=ok\">";
|
||
|
}
|
||
|
?>
|
||
|
</head>
|
||
|
<body>
|
||
|
<?php
|
||
|
if (isset($_GET["test"])) {
|
||
|
echo "Temporäre Cookies werden " .
|
||
|
($temp ? " " : "nicht ") .
|
||
|
"unterstützt.<br />";
|
||
|
echo "Permanente Cookies werden " .
|
||
|
($perm ? " " : "nicht ") .
|
||
|
"unterstützt.";
|
||
|
} else {
|
||
|
echo "Cookies werden gesetzt ... ";
|
||
|
}
|
||
|
?>
|
||
|
</body>
|
||
|
</html>
|