Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
UCookie Class Reference

Http Cookies utilities Ubiquity\utils\http$UCookie This class is part of Ubiquity. More...

Static Public Member Functions

static set ($name, $value, $duration=60 *60 *24, $path='/', $secure=false, $httpOnly=false)
 Sends a cookie.
 
static get ($name, $default=null)
 Returns the Cookie with the name $name.
 
static delete ($name, $path='/')
 Removes the cookie with the name $name.
 
static deleteAll ($path='/')
 Deletes all cookies.
 
static exists ($name)
 Tests the existence of a cookie.
 
static setRaw ($name, $value, $duration=60 *60 *24, $path='/', $secure=false, $httpOnly=false)
 Sends a raw cookie without urlencoding the cookie value.
 
static filter (string $key, int $filter=\FILTER_DEFAULT, $default=null)
 Gets a specific cookie by name and optionally filters it.
 
static setTransformer (TransformerInterface $transformer)
 
static getTransformerClass ()
 

Static Public Attributes

static $useTransformer = false
 

Static Private Attributes

static $transformer
 

Detailed Description

Http Cookies utilities Ubiquity\utils\http$UCookie This class is part of Ubiquity.

Author
jcheron myadd.nosp@m.ress.nosp@m.mail@.nosp@m.gmai.nosp@m.l.com
Version
1.1.4

Definition at line 16 of file UCookie.php.

Member Function Documentation

◆ delete()

static delete (   $name,
  $path = '/' 
)
static

Removes the cookie with the name $name.

Parameters
string$name
string$path

Definition at line 64 of file UCookie.php.

◆ deleteAll()

static deleteAll (   $path = '/')
static

Deletes all cookies.

Definition at line 74 of file UCookie.php.

◆ exists()

static exists (   $name)
static

Tests the existence of a cookie.

Parameters
string$name
Returns
boolean
Since
Ubiquity 2.0.11

Definition at line 87 of file UCookie.php.

◆ filter()

static filter ( string  $key,
int  $filter = \FILTER_DEFAULT,
  $default = null 
)
static

Gets a specific cookie by name and optionally filters it.

Parameters
string$key
int$filter
mixed | null$default
Returns
mixed|null

Definition at line 117 of file UCookie.php.

◆ get()

static get (   $name,
  $default = null 
)
static

Returns the Cookie with the name $name.

Parameters
string$name
mixed$default
Returns
mixed

Definition at line 50 of file UCookie.php.

◆ getTransformerClass()

static getTransformerClass ( )
static

Definition at line 126 of file UCookie.php.

◆ set()

static set (   $name,
  $value,
  $duration = 60 * 60 * 24,
  $path = '/',
  $secure = false,
  $httpOnly = false 
)
static

Sends a cookie.

Parameters
string$namethe name of the cookie
string$valueThe value of the cookie.
int$durationdefault : 1 day
string$pathdefault : / the cookie will be available within the entire domain
boolean$secureIndicates that the cookie should only be transmitted over asecure HTTPS
boolean$httpOnlyWhen true the cookie will be made accessible only through the HTTPprotocol
Returns
boolean

Definition at line 36 of file UCookie.php.

◆ setRaw()

static setRaw (   $name,
  $value,
  $duration = 60 * 60 * 24,
  $path = '/',
  $secure = false,
  $httpOnly = false 
)
static

Sends a raw cookie without urlencoding the cookie value.

Parameters
string$namethe name of the cookie
string$valueThe value of the cookie.
int$durationdefault : 1 day
string$pathdefault : / the cookie will be available within the entire domain
boolean$secureIndicates that the cookie should only be transmitted over a secure HTTPS
boolean$httpOnlyWhen true the cookie will be made accessible only through the HTTP protocol
Returns
boolean
Since
Ubiquity 2.0.11

Definition at line 103 of file UCookie.php.

◆ setTransformer()

static setTransformer ( TransformerInterface  $transformer)
static

Definition at line 121 of file UCookie.php.

Field Documentation

◆ $transformer

$transformer
staticprivate

Definition at line 22 of file UCookie.php.

◆ $useTransformer

$useTransformer = false
static

Definition at line 23 of file UCookie.php.


The documentation for this class was generated from the following file: