$exptime ? time()+3600*24*14:0, 'domain' => '', 'httponly' => false, 'samesite' => 'None', 'secure' => true, 'path' => '/' ]; return $Options; } //idapi 写cookie方式 function set_idcookie($name, $value, array $options) { setcookie($name,$value,$options['expires'],'/'); /*if(id_ChromeVer()<79){ setcookie($name,$value,$options['expires'],'/'); }else{ $header = 'Set-Cookie:'; $header .= rawurlencode($name) . '=' . rawurlencode($value) . ';'; if (isset($options['expires'])) { $header .= 'expires=' . \gmdate('D, d-M-Y H:i:s T', $options['expires']) . ';'; } if (isset($options['expires'])) { $header .= 'Max-Age=' . max(0, (int) ($options['expires'] - time())) . ';'; } if (!empty($options['path'])) { $header .= 'path=' . $options['path']. ';'; } if (!empty($options['domain'])) { $header .= 'domain=' . rawurlencode($options['domain']) . ';'; } if (!empty($options['secure'])) { $header .= 'Secure;'; } if (!empty($options['httponly'])) { $header .= 'HttpOnly;'; } if (!empty($options['samesite'])) { $header .= 'SameSite=' . rawurlencode($options['samesite']); } header($header, false); } */ } //Chrome版本 function id_ChromeVer(){ if (empty($_SERVER['HTTP_USER_AGENT'])){ return 'unknow'; } $agent= $_SERVER['HTTP_USER_AGENT']; if (preg_match('/Chrome\/(\d+)\..*/i', $agent, $regs)){ return $regs[1]; } else{ return 'unknow'; } } ?>