53 bool $mustExists =
false,
54 bool $mergeDefault =
true
58 if ((
true === $mustExists ) && (
false === isset($_COOKIE[ $name ])))
66 foreach( $temp as $optkey => $optvalue )
70 $options[$optkey] = $optvalue;
75 if (
true === $mergeDefault )
78 $options = array_merge($defaults, $options);
82 $cookie = setcookie($name, $value, $options);
185 'samesite' => [
'type' =>
'string',
'default' =>
'Lax',
'range' => [
'none',
'lax',
'strict']],
186 'httponly' => [
'type' =>
'bool',
'default' =>
true],
187 'lifetime' => [
'type' =>
'integer_eval',
'default' => (3*3600)],
188 'domain' => [
'type' =>
'string',
'default' =>
'/']
191 $ini_file_name = LEPTON_PATH .
"/config/lepton.ini.php";
192 if (
true === file_exists($ini_file_name))
194 $config = parse_ini_string(
";" . file_get_contents($ini_file_name),
true);
195 if (isset($config[
'lepton_cookie']))
197 foreach($config[
'lepton_cookie'] as $key => $value)
199 $returnValues[$key] = $value;
204 $oREQUEST = LEPTON_request::getInstance();
206 foreach ($returnValues as $key => &$val)
208 if (isset($vals[$key]))
210 $val = $oREQUEST->filterValue(
213 $vals[$key][
'default'],
214 $vals[$key][
'range'] ??
''
218 return $returnValues;