PHP Класс common\Cookie

Наследование: extends SpoonCookie
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
delete ( ) Deletes one or more cookies.
hasAllowedCookies ( ) : boolean Has the visitor allowed cookies?
hasHiddenCookieBar ( ) : boolean Has the cookiebar been hidden by the visitor
set ( string $key, mixed $value, integer $time = 2592000, string $path = '/', string $domain = null, boolean $secure = null, boolean $httpOnly = true ) : boolean Stores a value in a cookie, by default the cookie will expire in one day.

Описание методов

delete() публичный статический метод

This overwrites the spoon cookie method and adds the same functionality as in the set method to automatically set the domain.
public static delete ( )

hasAllowedCookies() публичный статический метод

Has the visitor allowed cookies?
public static hasAllowedCookies ( ) : boolean
Результат boolean

hasHiddenCookieBar() публичный статический метод

Has the cookiebar been hidden by the visitor
public static hasHiddenCookieBar ( ) : boolean
Результат boolean

set() публичный статический метод

Stores a value in a cookie, by default the cookie will expire in one day.
public static set ( string $key, mixed $value, integer $time = 2592000, string $path = '/', string $domain = null, boolean $secure = null, boolean $httpOnly = true ) : boolean
$key string A name for the cookie.
$value mixed The value to be stored. Keep in mind that they will be serialized.
$time integer The number of seconds that this cookie will be available, 30 days is the default.
$path string The path on the server in which the cookie will be available. Use / for the entire domain, /foo if you just want it to be available in /foo.
$domain string The domain that the cookie is available on. Use .example.com to make it available on all subdomains of example.com.
$secure boolean Should the cookie be transmitted over a HTTPS-connection? If true, make sure you use a secure connection, otherwise the cookie won't be set.
$httpOnly boolean Should the cookie only be available through HTTP-protocol? If true, the cookie can't be accessed by Javascript, ...
Результат boolean If set with success, returns true otherwise false.