Session Class

package Fuel
category Core
author Harro "WanWizard" Verton
link http://docs.fuelphp.com/classes/session.html

 Methods

Initialize by loading config & starting default session

_init() 

write the session

close(bool $save) : \Session_Driver

Parameters

$save

bool

if true, save the session on close

Returns

\Session_Driver

delete a session variable

delete(string $name) : \Fuel\Core\Session_Driver

Parameters

$name

string

name of the variable to delete

Returns

delete session flash variables

delete_flash(string $name) : \Session_Driver

Parameters

$name

string

name of the variable to delete

Returns

\Session_Driver

destroy the current session

destroy() : \Session_Driver

Returns

\Session_Driver

Factory

forge(array | string $custom) : mixed

Produces fully configured session driver instances

Parameters

$custom

arraystring

full driver config or just driver type

Exceptions

\FuelException
\Session_Exception

Returns

mixed

get session variables

get(string $name, mixed $default) : mixed

Parameters

$name

string

name of the variable to get

$default

mixed

default value to return if the variable does not exist

Returns

mixed

get session flash variables

get_flash(string $name, mixed $default, bool $expire) : mixed

Parameters

$name

string

name of the variable to get

$default

mixed

default value to return if the variable does not exist

$expire

bool

true if the flash variable needs to expire immediately

Returns

mixed

create or return the driver instance

instance($instance) : \Session_Driver

Parameters

$instance

void

Returns

\Session_Driverobject

keep session flash variables

keep_flash(string $name) : \Session_Driver

Parameters

$name

string

name of the variable to keep

Returns

\Session_Driver

get session key variables

key(string $name) : mixed

Parameters

$name

string

name of the variable to get, default is 'session_id'

Returns

mixed

reset the session

reset() : \Session_Driver

Returns

\Session_Driver

rotate the session id

rotate() : \Session_Driver

Returns

\Session_Driver

set session variables

set(string | array $name, mixed $value) : \Session_Driver

Parameters

$name

stringarray

name of the variable to set or array of values, array(name => value)

$value

mixed

value

Returns

\Session_Driver

set session flash variables

set_flash(string $name, mixed $value) : void

Parameters

$name

string

name of the variable to set

$value

mixed

value

start the session

start() : \Session_Driver

Returns

\Session_Driver

class constructor

__construct() 

 Properties

 

array of global config defaults

$_defaults 

 

default session driver instance

$_instance 

 

array of loaded instances

$_instances