\Cookies

Copyright (c) 2013, dsphinx@plug.gr All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by the dsphinx@plug.gr.
  4. Neither the name of the dsphinx@plug.gr nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY dsphinx@plug.gr ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL dsphinx@plug.gr BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Summary

Methods
Properties
Constants
Exists()
IsEmpty()
Get()
Set()
Delete()
No public properties found
Session
OneDay
SevenDays
ThirtyDays
SixMonths
OneYear
Lifetime
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

Session

Session

OneDay

OneDay

SevenDays

SevenDays

ThirtyDays

ThirtyDays

SixMonths

SixMonths

OneYear

OneYear

Lifetime

Lifetime

Methods

Exists()

Exists(string  $name) : boolean

Returns true if there is a cookie with this name.

Parameters

string $name

Returns

boolean

IsEmpty()

IsEmpty(string  $name) : boolean

Returns true if there no cookie with this name or it's empty, or 0, or a few other things. Check http://php.net/empty for a full list.

Parameters

string $name

Returns

boolean

Get()

Get(string  $name, string  $default = '') : mixed

Get the value of the given cookie. If the cookie does not exist the value of $default will be returned.

Parameters

string $name
string $default

Returns

mixed

Set()

Set(string  $name, string  $value, mixed  $expiry = self::Session, string  $path = '/', string  $domain = FALSE) : boolean

Set a cookie. Silently does nothing if headers have already been sent.

Parameters

string $name
string $value
mixed $expiry
string $path
string $domain

Returns

boolean

Delete()

Delete(string  $name, string  $path = '/', string  $domain = FALSE, boolean  $remove_from_global = FALSE) : boolean

Delete a cookie.

Parameters

string $name
string $path
string $domain
boolean $remove_from_global

Set to true to remove this cookie from this request.

Returns

boolean