1 | <?php /** MicroCookie */ |
||
17 | class Cookie implements ICookie |
||
|
|||
18 | { |
||
19 | /** @var IRequest $request */ |
||
20 | protected $request; |
||
21 | |||
22 | |||
23 | /** |
||
24 | * Constructor of object |
||
25 | * |
||
26 | * @access public |
||
27 | * |
||
28 | * @param IRequest $request |
||
29 | * |
||
30 | * @result void |
||
31 | */ |
||
32 | public function __construct(IRequest $request) |
||
36 | |||
37 | /** |
||
38 | * Get cookie |
||
39 | * |
||
40 | * @access public |
||
41 | * |
||
42 | * @param string $name cookie name |
||
43 | * |
||
44 | * @return mixed|bool |
||
45 | */ |
||
46 | public function get($name) |
||
50 | |||
51 | /** |
||
52 | * Delete cookie |
||
53 | * |
||
54 | * @access public |
||
55 | * |
||
56 | * @param string $name cookie name |
||
57 | * |
||
58 | * @return bool |
||
59 | */ |
||
60 | public function del($name) |
||
68 | |||
69 | /** |
||
70 | * Exists cookie |
||
71 | * |
||
72 | * @access public |
||
73 | * |
||
74 | * @param string $name cookie name |
||
75 | * |
||
76 | * @return bool |
||
77 | */ |
||
78 | public function exists($name) |
||
82 | |||
83 | /** |
||
84 | * Set cookie |
||
85 | * |
||
86 | * @access public |
||
87 | * |
||
88 | * @param string $name cookie name |
||
89 | * @param mixed $value data value |
||
90 | * @param int $expire life time |
||
91 | * @param string $path path access cookie |
||
92 | * @param string $domain domain access cookie |
||
93 | * @param bool $secure use SSL? |
||
94 | * @param bool $httponly disable on JS? |
||
95 | * |
||
96 | * @return bool |
||
97 | */ |
||
98 | public function set($name, $value, $expire = 0, $path = '/', $domain = '', $secure = false, $httponly = true) |
||
102 | } |
||
103 |