.

Cookie Class Reference
[Lib]

Wraps Cookie Handling. More...

List of all members.

Static Public Member Functions

static  create ($name, $content, $valid_seconds=null, $path= '/', $http_only=true, $domain=false, $ssl=false)
  Create Cookie.
static  delete ($name)
  Delete cookie.
static  exists ($name)
  Returns true if cookie exists, false otherwise.
static  get_cookie_value ($name)
  Returns value form given cookie, if exists, false otherwise.

Detailed Description

Wraps Cookie Handling.

Author:
Gerd Riesselmann

Definition at line 8 of file cookie.cls.php.


Member Function Documentation

static Cookie::create ( name,
content,
valid_seconds = null,
path = '/',
http_only = true,
domain = false,
ssl = false  
) [static]

Create Cookie.

Parameters:
string  Name of Cookie
string  Cotent of Cookuie
int  Number of seconds the cookie will be valid

Definition at line 16 of file cookie.cls.php.

00016                                                                                                                                              {
00017                 $expire = empty($valid_seconds) ? null : time() + Cast::int($valid_seconds); 
00018                 setcookie($name, $content, $expire, $path, $domain, $ssl, $http_only);
00019         }
static Cookie::delete ( name  )  [static]

Delete cookie.

Parameters:
string  Name of cookie to delete

Definition at line 26 of file cookie.cls.php.

00026                                              {
00027                 setcookie($name, '', time() - 24 * 60 * 60, '/');
00028         }
static Cookie::exists ( name  )  [static]

Returns true if cookie exists, false otherwise.

Parameters:
string  Name of cookie

Definition at line 35 of file cookie.cls.php.

00035                                              {
00036                 return isset($_COOKIE[$name]);
00037         }
static Cookie::get_cookie_value ( name  )  [static]

Returns value form given cookie, if exists, false otherwise.

Definition at line 42 of file cookie.cls.php.

00042                                                        {
00043                 return Arr::get_item($_COOKIE, $name, false);
00044         }

The documentation for this class was generated from the following file: