Overview

Namespaces

  • MvcCore
    • Ext
      • Auth
        • Virtual
      • Debug
        • Tracy
      • Form
        • Core
        • Validators
      • Request
      • Router
        • Lang
      • View
        • Helpers
  • None

Classes

  • Config
  • Controller
  • Debug
  • Model
  • Request
  • Response
  • Route
  • Router
  • Session
  • Tool
  • View
  • Overview
  • Namespace
  • Class
  • Tree

Class Session

Core session: - session safe starting - session writing and closing - by registered shutdown function - \MvcCore\Session::Close() - how to register the handler - close handler called registered by \MvcCore::Terminate(); - session namespaces management - variables expiration by seconds - variables expiration by request hoops

ArrayObject implements IteratorAggregate, Traversable, ArrayAccess, Serializable, Countable
Extended by MvcCore\Session
Namespace: MvcCore
Located at mvccore/src/MvcCore/Session.php
Methods summary
public static
# Start( )

Start session, called in Controller::Init(); It's also possible to call this anywhere sooner, for example in bootstrap by: \MvcCore::SessionStart();

Start session, called in Controller::Init(); It's also possible to call this anywhere sooner, for example in bootstrap by: \MvcCore::SessionStart();

protected static
# setUpMeta( )

Set up session metadata about namespaces names, hoops and expirations

Set up session metadata about namespaces names, hoops and expirations

protected static
# setUpData( )

Set up namespaces data - only if they has not expired

Set up namespaces data - only if they has not expired

public static
# Close( )

Write and close session in \MvcCore::Terminate(); Serialize all metadata and call php function to write session.

Write and close session in \MvcCore::Terminate(); Serialize all metadata and call php function to write session.

public static MvcCore\Session &
# GetNamespace( string $name = 'default' )

Get new or existed session namespace

Get new or existed session namespace

Parameters

$name

Returns

MvcCore\Session
public MvcCore\Session
# __construct( string $name = 'default' )

Get new or existed session namespace

Get new or existed session namespace

Parameters

$name

Returns

MvcCore\Session

Overrides

ArrayObject::__construct()
public MvcCore\Session
# SetExpirationHoops( integer $hoops )

Set expiration page requests count

Set expiration page requests count

Parameters

$hoops

Returns

MvcCore\Session
public MvcCore\Session
# SetExpirationSeconds( integer $seconds )

Set expiration seconds

Set expiration seconds

Parameters

$seconds
$hoops

Returns

MvcCore\Session
public
# Destroy( )

Destroy whole session namespace

Destroy whole session namespace

public boolean
# __isset( string $key )

Magic function triggered by: isset($session->key);

Magic function triggered by: isset($session->key);

Parameters

$key

Returns

boolean
public
# __unset( string $key )

Magic function triggered by: unset($session->key);

Magic function triggered by: unset($session->key);

Parameters

$key
public mixed
# __get( string $key )

Magic function triggered by: $value = $session->key;

Magic function triggered by: $value = $session->key;

Parameters

$key

Returns

mixed
public
# __set( string $key, mixed $value )

Magic function triggered by: $session->key = "value";

Magic function triggered by: $session->key = "value";

Parameters

$key
$value
public integer
# count( )

ArrayObject function triggered by: count($session;

ArrayObject function triggered by: count($session;

Returns

integer

Overrides

ArrayObject::count()
Methods inherited from ArrayObject
append(), asort(), exchangeArray(), getArrayCopy(), getFlags(), getIterator(), getIteratorClass(), ksort(), natcasesort(), natsort(), offsetExists(), offsetGet(), offsetSet(), offsetUnset(), serialize(), setFlags(), setIteratorClass(), uasort(), uksort(), unserialize()
Constants summary
string SESSION_METADATA_KEY

Metadata key in $_SESSION

Metadata key in $_SESSION

# '__MC'
Constants inherited from ArrayObject
ARRAY_AS_PROPS, STD_PROP_LIST
Properties summary
protected string $__name

Default namespace name

Default namespace name

# 'default'
protected static boolean $started

Boolean telling about if session is started

Boolean telling about if session is started

# FALSE
protected static array|stdClass $meta

Metadata array or stdClass with elements: names, hoops and expirations - all items are arrays

Metadata array or stdClass with elements: names, hoops and expirations - all items are arrays

# array()
protected static array $instances

Array of created \MvcCore\Session instances, keys in array are session namespaces names

Array of created \MvcCore\Session instances, keys in array are session namespaces names

# array()
MvcCore API documentation generated by ApiGen