You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
546 B
PHP
29 lines
546 B
PHP
<?php
|
|
|
|
namespace App\Utils;
|
|
|
|
class Cookie
|
|
{
|
|
public static function set($arg, $time)
|
|
{
|
|
foreach ($arg as $key => $value) {
|
|
setcookie($key, $value, $time, '/');
|
|
}
|
|
}
|
|
|
|
public static function setwithdomain($arg, $time, $domain)
|
|
{
|
|
foreach ($arg as $key => $value) {
|
|
setcookie($key, $value, $time, '/', $domain);
|
|
}
|
|
}
|
|
|
|
public static function get($key)
|
|
{
|
|
if (isset($_COOKIE[$key])) {
|
|
return $_COOKIE[$key];
|
|
}
|
|
return "";
|
|
}
|
|
}
|