ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilWACDummyCookie.php
Go to the documentation of this file.
1<?php
2require_once('./Services/WebAccessChecker/interfaces/interface.ilWACCookieInterface.php');
3
10
14 protected static $expires = array();
18 protected static $values = array();
19
20
31 public function set($name, $value = "", $expire = 0, $path = "", $domain = "", $secure = false, $httponly = false) {
32 static::$expires[$name] = $expire;
33 static::$values[$name] = $value;
34 $_COOKIE[$name] = $value;
35 }
36
37
42 public function get($name) {
43 if (!$this->exists($name)) {
44 return false;
45 }
46
47 return static::$values[$name];
48 }
49
50
55 public function exists($name) {
56 if (!isset(static::$expires[$name]) || (static::$expires[$name] !== 0 && static::$expires[$name] <= time())) {
57 return false;
58 }
59
60 return isset(static::$values[$name]);
61 }
62
63
67 public function getAll() {
68 $return = array();
69 foreach (self::$values as $key => $value) {
70 if ($this->exists($key)) {
71 $return[$key] = $value;
72 }
73 }
74
75 return $return;
76 }
77
78
79 public static function clear() {
80 self::$expires = array();
81 self::$values = array();
82 }
83}
$_COOKIE['ilClientId']
Definition: BPMN2Parser.php:15
$path
Definition: aliased.php:25
An exception for terminatinating execution or to throw for unit testing.
Class ilWACDummyCookie.
Class ilWACCookieInterface.