CMS Made Simple API

cms_cookies
in package

FinalYes

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

Tags
license

GPL

author

Robert Campbell

copyright

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

since
1.10

Table of Contents

Methods

erase()  : mixed
Erase a cookie
exists()  : bool
Test if a cookie exists.
get()  : mixed
Get the value of a cookie
set()  : bool
Set a cookie

Methods

erase()

Erase a cookie

public static erase(string $key) : mixed
Parameters
$key : string

The cookie name

exists()

Test if a cookie exists.

public static exists(string $key) : bool
Parameters
$key : string

The cookie name.

Tags
since
1.11
Return values
bool

get()

Get the value of a cookie

public static get(string $key) : mixed
Parameters
$key : string

The cookie name

Tags
@return

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

set()

Set a cookie

public static set(string $key, string $value[, int $expire = 0 ]) : bool
Parameters
$key : string

The cookie name

$value : string

The cookie value

$expire : int = 0

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

Return values
bool

        
On this page

Search results