Static Gems cookie utilities

package Gems
subpackage Cookies
copyright Copyright (c) 2011 Erasmus MC
license New BSD License
since Class available since version 1.0

 Methods

Get a specific cookie from the request.

get(\Zend_Controller_Request_Abstract $request, string $name, mixed $default = null) : mixed
Static

Parameters

$request

\Zend_Controller_Request_Abstract

$name

string

$default

mixed

Returns

mixedCookie value

Get the current locale from the cookie.

getLocale(\Zend_Controller_Request_Abstract $request) : string
Static

Parameters

$request

\Zend_Controller_Request_Abstract

Returns

stringThe current locale

Get the current organization from the cookie.

getOrganization(\Zend_Controller_Request_Abstract $request) : integer
Static

Parameters

$request

\Zend_Controller_Request_Abstract

Returns

integerThe current organization

Store this cookie in a generic save method that works for both sub-directory installations and own url installations.

set(string $name, mixed $value, integer $days = 30, string $basepath = '/') : boolean
Static

Parameters

$name

string

Name of the cookie

$value

mixed

Value to set

$days

integer

Number of days to keep this cookie

$basepath

string

The folder of the domain, if any.

Returns

booleanTrue if the cookie was stored.

Store the locale in a cookie.

setLocale(string $locale, string $basepath = '/') : boolean
Static

Parameters

$locale

string

Locale to store

$basepath

string

The folder of the domain, if any.

Returns

booleanTrue if the cookie was stored.

Store the organization in a cookie.

setOrganization(integer $organization, string $basepath = '/') : boolean
Static

Parameters

$organization

integer

Organization to store

$basepath

string

The folder of the domain, if any.

Returns

booleanTrue if the cookie was stored.

 Constants