| Server IP : 104.21.31.197 / Your IP : 162.159.108.58 Web Server : nginx/1.20.2 System : Linux 172-104-110-161.ip.linodeusercontent.com 3.10.0-1160.36.2.el7.x86_64 #1 SMP Wed Jul 21 11:57:15 UTC 2021 x86_64 User : www ( 1000) PHP Version : 8.1.9 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /www/wwwroot/data.dell-driver-download.com/framework-4.1.3/system/Helpers/ |
Upload File : |
<?php
/**
* This file is part of the CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Config\App;
use Config\Services;
//=============================================================================
// CodeIgniter Cookie Helpers
//=============================================================================
if (! function_exists('set_cookie'))
{
/**
* Set cookie
*
* Accepts seven parameters, or you can submit an associative
* array in the first parameter containing all the values.
*
* @param string|array $name Cookie name or array containing binds
* @param string $value The value of the cookie
* @param string $expire The number of seconds until expiration
* @param string $domain For site-wide cookie. Usually: .yourdomain.com
* @param string $path The cookie path
* @param string $prefix The cookie prefix
* @param boolean $secure True makes the cookie secure
* @param boolean $httpOnly True makes the cookie accessible via http(s) only (no javascript)
* @param string|null $sameSite The cookie SameSite value
*
* @see \CodeIgniter\HTTP\Response::setCookie()
*/
function set_cookie(
$name,
string $value = '',
string $expire = '',
string $domain = '',
string $path = '/',
string $prefix = '',
bool $secure = false,
bool $httpOnly = false,
string $sameSite = null
)
{
$response = Services::response();
$response->setCookie($name, $value, $expire, $domain, $path, $prefix, $secure, $httpOnly, $sameSite);
}
}
if (! function_exists('get_cookie'))
{
/**
* Fetch an item from the $_COOKIE array
*
* @param string $index
* @param boolean $xssClean
*
* @return mixed
*
* @see \CodeIgniter\HTTP\IncomingRequest::getCookie()
*/
function get_cookie($index, bool $xssClean = false)
{
$prefix = isset($_COOKIE[$index]) ? '' : config(App::class)->cookiePrefix;
$request = Services::request();
$filter = $xssClean ? FILTER_SANITIZE_STRING : FILTER_DEFAULT;
return $request->getCookie($prefix . $index, $filter);
}
}
if (! function_exists('delete_cookie'))
{
/**
* Delete a cookie
*
* @param mixed $name
* @param string $domain the cookie domain. Usually: .yourdomain.com
* @param string $path the cookie path
* @param string $prefix the cookie prefix
*
* @return void
*
* @see \CodeIgniter\HTTP\Response::deleteCookie()
*/
function delete_cookie($name, string $domain = '', string $path = '/', string $prefix = '')
{
Services::response()->deleteCookie($name, $domain, $path, $prefix);
}
}
if (! function_exists('has_cookie'))
{
/**
* Checks if a cookie exists by name.
*
* @param string $name
* @param string|null $value
* @param string $prefix
*
* @return boolean
*/
function has_cookie(string $name, string $value = null, string $prefix = ''): bool
{
return Services::response()->hasCookie($name, $value, $prefix);
}
}