SofaDoc

SofaDoc Map Usage

inc/cookies.php

Provides functions to deal with cookies.
The functions are used by index.php and api.php
The calls to the functions are in the api.php after including site/configuration.php
and only if api.php is invoked by index.php.
This order allows to access cookie functions in configuration.php

Functions

swHandleCookie($id,$default='',$period=,$refresh=true)

Returns parameters either from the $_COOKIE, $_GET and $_POST.
If $_GET or $_POST deliver a value, it is saved to $_COOKIE
Typical use cases are $lang, $skin and $username
Uses the global $swCookiePrefix from site/configuration.php to set a cookie name.
$swCookiePrefix allows to have multiple wikis on the same domain.
@param $id
@param $default value if neither COOKIE nor GET nor POST are set.
@param $period lifetime of the cookie in seconds
@param $refresh if true (by default), cookie gets new fresh period each time

swGetCookie($id,$period=,$refresh=true)

Returns parameters from $_COOKIE.
Respects the global $swCookiePrefix.
@param $id

swSetCookie($id,$value,$period=)

Sets a $_COOKIE value.
Respects the global $swCookiePrefix.
@param $id
@param $value
@period lifetime of the cookie in seconds

swCookieTest($s='')

Functions

echotime

Globals

$_COOKIE, $_GET, $_POST, $swCookiePrefix

Variables

$default, $period, $refresh, $result, $value

Short variables: $id, $key, $v

Features

array, math, network, time