final public function __construct(string
$name, string
$value = '', array
$options =
[]) { $options += self::
$defaults;
$options['expires'
] =
static::
convertExpiresTimestamp($options['expires'
]);
// If both `Expires` and `Max-Age` are set, `Max-Age` has precedence.
if (isset($options['max-age'
]) &&
is_numeric($options['max-age'
])) { $options['expires'
] = Time::
now()->
getTimestamp() +
(int) $options['max-age'
];
unset($options['max-age'
]);
} // to preserve backward compatibility with array-based cookies in previous CI versions
$prefix =
($options['prefix'
] === ''
) ? self::
$defaults['prefix'
] :
$options['prefix'
];
$path =
$options['path'
] ?: self::
$defaults['path'
];
$domain =
$options['domain'
] ?: self::
$defaults['domain'
];