cms_cookies View code

A simple static class providing convenience utilities for working with cookies.

package

CMS

license

GPL

author

Robert Campbell

copyright

Copyright (c) 2010, Robert Campbell calguy1000@cmsmadesimple.org

since 1.10

Methods

set(string $key, string $value, integer $expire) : boolean

Set a cookie

static

Arguments

string $key

The cookie name

string $value

The cookie value

integer $expire

Unix timestamp of the time the cookie will expire. By default cookies that expire when the browser closes will be created.

Response

boolean

get(string $key) : \mixed.

Get the value of a cookie

static

Arguments

string $key

The cookie name

Response

\mixed.

Null if the cookie does not exist, otherwise a string containing the cookie value.

exists(string $key) : boolean

Test if a cookie exists.

static

Arguments

string $key

The cookie name.

Response

boolean

erase(string $key) 

Erase a cookie

static

Arguments

string $key

The cookie name