ICanBoogie/Session master
  • Namespace
  • Class

Namespaces

  • ICanBoogie
    • Session

Classes

  • Session

Interfaces

  • SessionFlash
  • SessionOptions
  • SessionSegment

Class Session

Session.

ICanBoogie\Session implements ICanBoogie\SessionOptions, ICanBoogie\SessionSegment uses ICanBoogie\Accessor\AccessorTrait (not available) ICanBoogie\Session\SegmentTrait
Namespace: ICanBoogie
Located at Session.php

Methods summary

protected string
# get_id( )

Returns

string

Codecoverageignore

protected
# set_id( string $id )

Parameters

$id
protected string
# get_name( )

Returns

string
protected
# set_name( string $name )

Parameters

$name
protected string
# get_token( )

Returns

string
protected string
# get_cache_limiter( )

Returns

string
protected
# set_cache_limiter( string $cache_limiter )

Parameters

$cache_limiter
protected string
# get_cache_expire( )

Returns

string
protected
# set_cache_expire( string $cache_expire )

Parameters

$cache_expire
protected string
# get_module_name( )

Returns

string
protected
# set_module_name( string $module )

Parameters

$module
protected string
# get_save_path( )

Returns

string
protected
# set_save_path( string $path )

Parameters

$path
protected array
# get_cookie_params( )

Returns

array
protected
# set_cookie_params( array $params )

Parameters

$params
protected integer
# get_status( )

Return the current session status.

Return the current session status.

Returns

integer
protected boolean
# get_is_active( )

Whether sessions are enabled, and one exists.

Whether sessions are enabled, and one exists.

Returns

boolean
protected boolean
# get_is_disabled( )

Whether sessions are disabled.

Whether sessions are disabled.

Returns

boolean
protected boolean
# get_has_none( )

Whether sessions are enabled, but none exists.

Whether sessions are enabled, but none exists.

Returns

boolean
protected boolean
# get_is_referenced( )

Whether sessions id is referenced in the cookie.

Whether sessions id is referenced in the cookie.

Returns

boolean
protected &
# get_reference( )

Inheritdoc

protected
# get_segments( )
protected
# get_flash( )

Inheritdoc

public
# __construct( array $options = [] )

Parameters

$options
public
# __call( string $name, array $arguments )

Forward selected method to session functions.

Forward selected method to session functions.

Parameters

$name
$arguments
protected
# assert_is_forwardable( string $name )

Assert that a method is forwardable to a session function.

Assert that a method is forwardable to a session function.

Parameters

$name

Throws

BadMethodCallException
if the method is not forwardable
public boolean
# start( )

Initialize session data.

Initialize session data.

Note: If PHP is running from CLI the session_start() method is not invoked but a fake $_SESSION is still created.

Returns

boolean

See

session_start()

Codecoverageignore

public
# start_or_reuse( )

Start a new session or reuse the current one.

Start a new session or reuse the current one.

public
# clear( )

Clear the session of all data.

Clear the session of all data.

See

session_unset()

Codecoverageignore

Implementation of

ICanBoogie\SessionSegment::clear()
public boolean
# regenerate( )

Update the current session id and token.

Update the current session id and token.

Returns

boolean
true on success or false on failure.
protected string
# generate_token( )

Generate a session token.

Generate a session token.

Returns

string
public boolean
# verify_token( string $token )

Verify that a given token matches the session's token.

Verify that a given token matches the session's token.

Parameters

$token

Returns

boolean

Methods inherited from ArrayAccess

offsetExists(), offsetGet(), offsetSet(), offsetUnset()

Methods used from ICanBoogie\Session\SegmentTrait

__get(), accessor_get(), offsetExists(), offsetGet(), offsetSet(), offsetUnset()

Magic methods summary

public
# abort( )

Discard session array changes and finish session.

Discard session array changes and finish session.

public
# commit( )

Write session data and end session.

Write session data and end session.

public boolean
# decode( string $data )

Decodes session data from a session encoded string.

Decodes session data from a session encoded string.

Parameters

$data

Returns

boolean
public
# destroy( )

Destroys all data registered to a session.

Destroys all data registered to a session.

public string
# encode( )

Encodes the current session data as a session encoded string.

Encodes the current session data as a session encoded string.

Returns

string
public boolean
# regenerate_id( $delete_old_session = false )

Update the current session id with a newly generated one.

Update the current session id with a newly generated one.

Parameters

$delete_old_session

Returns

boolean
public
# reset( )

Re-initialize session array with original values.

Re-initialize session array with original values.

Constants summary

string TOKEN_NAME

Name of the session token, may be used as form hidden input name.

Name of the session token, may be used as form hidden input name.

# '__SESSION_TOKEN__'

Constants inherited from ICanBoogie\SessionOptions

DEFAULT_CACHE_EXPIRE, DEFAULT_CACHE_LIMITER, DEFAULT_ID, DEFAULT_MODULE_NAME, DEFAULT_NAME, DEFAULT_SAVE_PATH, OPTION_CACHE_EXPIRE, OPTION_CACHE_LIMITER, OPTION_COOKIE_PARAMS, OPTION_ID, OPTION_MODULE_NAME, OPTION_NAME, OPTION_SAVE_PATH

Properties summary

Magic properties

public string $id

Current session id.

public string $name

Current session name.

public string $cache_limiter

Current cache limiter.

public string $cache_expire

Current cache expire.

public array $cookie_params

Session cookie parameters.

public string $module_name

Current session module.

public string $save_path

Current session save path.

public ICanBoogie\SessionFlash $flash

The session flash.

public read-only integer $status

Current session status.

public read-only boolean $is_disabled

Whether sessions are enabled, but none exists.

public read-only boolean $is_active

Whether sessions are enabled, and one exists.

public read-only boolean $has_none

Whether sessions are enabled, but none exists.

public read-only boolean $is_referenced

Whether session id is referenced in the cookie.

public read-only ICanBoogie\Session\SegmentCollection $segments

Session segments.

public read-only string $token

Current session token that can be used to prevent CSRF.

Magic properties used from ICanBoogie\Session\SegmentTrait

$reference

ICanBoogie/Session master API documentation generated by ApiGen