Overview

Namespaces

  • None
  • Wei
    • Validator

Classes

  • Apc
  • App
  • ArrayCache
  • Asset
  • Base
  • BaseCache
  • BaseController
  • Bicache
  • Cache
  • Config
  • Cookie
  • Couchbase
  • Counter
  • Db
  • DbCache
  • E
  • Env
  • Error
  • FileCache
  • Gravatar
  • Http
  • Lock
  • Logger
  • Memcache
  • Memcached
  • MongoCache
  • Password
  • PhpError
  • PhpFileCache
  • Pinyin
  • Record
  • Redis
  • Request
  • Response
  • Router
  • SafeUrl
  • Session
  • Soap
  • T
  • Ua
  • Upload
  • Url
  • Uuid
  • Validate
  • View
  • WeChatApp
  • Wei
  • Overview
  • Namespace
  • Class

Class Session

A service that handles session data ($_SESSION)

Wei\Base
Extended by Wei\Session implements ArrayAccess, Countable, IteratorAggregate
Namespace: Wei
Author: Twin Huang twinhuang@qq.com
Located at Session.php
Methods summary
public
# __construct( array $options = array() )

Constructor

Constructor

Parameters

$options

Throws

InvalidArgumentException
When option "wei" is not an instance of "Wei\Wei"

Overrides

Wei\Base::__construct()
public
# start( )

Start session

Start session

Throws

RuntimeException
When header has been sent
public mixed
# __invoke( string $key, mixed $value = null )

Get or set session

Get or set session

Parameters

$key
The name of cookie
$value
The value of cookie

Returns

mixed
public mixed
# get( string $key, mixed $default = null )

Returns session value

Returns session value

Parameters

$key
The name of session
$default
The default parameter value if the session does not exist

Returns

mixed
public
# set( string|array $name, mixed $value = null )

Set session data

Set session data

Parameters

$name
The session name or A key-value array
$value
The session value

Returns


$this
public
# remove( string $name )

Remove session data by specified name

Remove session data by specified name

Parameters

$name
The name of session

Returns


$this
public boolean
# exists( string $name )

Check if the session is exists

Check if the session is exists

Parameters

$name

Returns

boolean
public
# clear( )

Clear session data

Clear session data

Returns


$this
public
# destroy( )

Destroy all session data

Destroy all session data

Returns


$this
public array
# toArray( )

Returns session data as array

Returns session data as array

Returns

array
public
# setInis( array $inis )

Set session configuration options

Set session configuration options

Parameters

$inis

Returns


$this
public boolean
# offsetExists( string $offset )

Check if the offset exists

Check if the offset exists

Parameters

$offset

Returns

boolean

Implementation of

ArrayAccess::offsetExists()
public mixed &
# offsetGet( string $offset )

Get the offset value

Get the offset value

Parameters

$offset

Returns

mixed

Implementation of

ArrayAccess::offsetGet()
public
# offsetSet( string $offset, mixed $value )

Set the offset value

Set the offset value

Parameters

$offset
$value

Implementation of

ArrayAccess::offsetSet()
public
# offsetUnset( string $offset )

Unset the offset

Unset the offset

Parameters

$offset

Implementation of

ArrayAccess::offsetUnset()
public integer
# count( )

Return the length of data

Return the length of data

Returns

integer
the length of data

Implementation of

Countable::count()
public ArrayIterator
# getIterator( )

Retrieve an array iterator

Retrieve an array iterator

Returns

ArrayIterator

Implementation of

IteratorAggregate::getIterator()
Methods inherited from Wei\Base
__call(), __get(), getOption(), setOption()
Properties summary
protected string|false $namespace

The namespace to store session data

The namespace to store session data

# false
protected array $data

The session data

The session data

# array()
protected array $inis

The session configuration options

The session configuration options

Link

http://php.net/manual/en/session.configuration.php
# array()
Properties inherited from Wei\Base
$providers, $wei
Wei Framework API documentation generated by ApiGen