Overview

Namespaces

  • LeanCloud
    • Engine
    • Operation
    • Storage
    • Uploader

Classes

  • CookieStorage
  • SessionStorage

Interfaces

  • IStorage
  • Overview
  • Namespace
  • Class

Class CookieStorage

Cookie Storage

Persist key value in client (web browser) cookies.

Notes:

  1. Since it uses PHP built-in setcookie, set value will fail after headers being sent.
  2. There are limits on number of bytes per cookie, and number of keys per client.
  3. And other caveats with setcookie.
LeanCloud\Storage\CookieStorage implements LeanCloud\Storage\IStorage
Namespace: LeanCloud\Storage
See: http://php.net/manual/en/function.setcookie.php
Located at LeanCloud/Storage/CookieStorage.php
Methods summary
public
# __construct( integer $seconds = 0, string $path = "/", string $domain = null )

Initilize cookie storage

Initilize cookie storage

Parameters

$seconds
Number of seconds to live
$path
Cookie path scope
$domain
Cookie domain scope
public
# set( string $key, mixed $val, integer $seconds = null )

Set value by key

Set value by key

Parameters

$key
$val
$seconds
Number of seconds to live

Returns


$this

Implementation of

LeanCloud\Storage\IStorage::set()
public mixed
# get( string $key )

Get value by key

Get value by key

Parameters

$key

Returns

mixed

Implementation of

LeanCloud\Storage\IStorage::get()
public
# remove( string $key )

Remove key from storage

Remove key from storage

Parameters

$key

Returns


$this

Implementation of

LeanCloud\Storage\IStorage::remove()
public
# clear( )

Clear all data in storage

Clear all data in storage

Returns


$this

Throws

RuntimeException

Implementation of

LeanCloud\Storage\IStorage::clear()
API documentation generated by ApiGen