xplo.re Medusa Core Framework 3.1
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Event
  • Todo
  • Download

Namespaces

  • Core
    • Authentication
      • Auto
        • Driver
      • Driver
    • Cache
      • Driver
    • Charset
      • Driver
    • Configuration
    • Controller
    • Converter
      • Driver
    • Decoder
      • Driver
    • Encoder
      • Driver
    • Env
      • Authentication
      • Locale
      • Proxy
      • Server
        • HTTP
        • Redirect
        • X
    • Exception
    • Exchange
      • Driver
    • Field
    • Filter
      • Driver
    • Formatter
      • Driver
        • coreuimarkup
          • Token
    • Hash
    • Loader
    • Locale
    • Log
      • Driver
    • Module
      • Dependency
        • Requirement
          • Core
          • PHP
      • Linkage
        • Driver
    • PDF
    • Plugin
    • Query
      • Driver
    • Server
      • Driver
    • Session
      • Driver
    • Set
    • Storage
      • Driver
      • Field
        • Element
    • Stream
      • Driver
    • String
    • Translation
      • Driver
      • Language
        • Driver
    • URI
      • Driver
    • Version
    • View
      • Driver
        • coreui
          • Control
            • Button
            • Table
          • Element
        • htmlbuilder
          • Tags
        • yui
          • Modules
  • None
  • PHP

Classes

  • Authentication
  • Authentication_Token
  • Autoloader
  • Cache
  • Charset
  • ClassDescriptor
  • Closure
  • Controller
  • Converter
  • Date
  • Decoder
  • Delegate
  • Dispatcher
  • Encoder
  • Env
  • Env_Field
  • Env_File
  • Env_FileList
  • Env_Request
  • Env_SERVER
  • Exchange
  • Fault
  • Field
  • Filter
  • Filter_Value
  • Formatter
  • Hash
  • IP
  • Loader
  • Locale
  • Locale_Iterator
  • Locale_Node
  • Log
  • Module
  • Module_Iterator
  • Nothing
  • Object
  • OS
  • Plugin
  • Profiler
  • Query
  • Registry
  • Resource
  • Server
  • Session
  • Session_Token
  • Set
  • Storage
  • Storage_Result
  • Storage_Statement
  • Stream
  • String
  • Translation
  • URI
  • URI_Parameters
  • UUID
  • Value
  • Version
  • View

Interfaces

  • Accessor
  • Chainable
  • Comparable
  • Configurable
  • Equality
  • Identity
  • Inquiry
  • Masquerade
  • Mutator
  • SeekableStream
  • Storable
  • Variator

Exceptions

  • Exception

Constants

  • Copyright
  • ProductName
  • UseVersion
  • Version

Functions

  • ns_expand
  • ns_file_exists
  • ns_get_version
  • ns_resolve

Class Session

Session interface.

Core\Object implements Core\Chainable
Extended by Core\Set implements Core\Accessor
Extended by Core\Session

Direct known subclasses

Core\Session\Driver\files, Core\Session\Driver\sqlite, Core\Session\Driver\storage

Abstract
Namespace: Core
Package: Core\Session
Since: 3.0
Requires: PHP 5.3
Version: 1.0
Located at Session.inc.php

Methods summary

protected
# __construct( Core\URI $uri )

Use auto-create factory to instantiate a session driver instance.

Use auto-create factory to instantiate a session driver instance.

Parameters

$uri
Driver configuration URI.

Since

3.0
public
# __destruct( )

Deactivates the current session, if active, and releases all resources.

Deactivates the current session, if active, and releases all resources.

Since

3.0
abstract protected
# _setHandler( )

Resets the PHP session handler information.

Resets the PHP session handler information.

Remark

Subclasses are required to overwrite this method and set their own session handler.


Since

3.0
protected
# _setParameters( )

Resets the PHP session configuration.

Resets the PHP session configuration.

Since

3.0
public
# activate( boolean $deactivatePrevious = false )

Activates the current session.

Activates the current session.

Parameters

$deactivatePrevious

Optional. If set to true, an active session (if any) is automatically deactivated, before the current session is activated.

Throws

Core\Exception\Runtime

Cannot activate session if another session is still active and deactivation of a previous session is not enabled.

Since

3.0
public boolean
# active( )

Returns, whether the current session is the currently active session.

Returns, whether the current session is the currently active session.

Returns

boolean
true, if the current session is active, otherwise false.

Since

3.0
public static Core\Session
# activeInstance( )

Returns the currently active session instance.

Returns the currently active session instance.

Returns

Core\Session
Currently active session instance of null, if no session is active.

Since

3.0
public static Core\Session
# autocreate( Core\URI $uri )

Session driver factory.

Session driver factory.

Parameters

$uri
Driver configuration URI.

Returns

Core\Session
New session object specific to the named interface.

Throws

Core\Exception\InvalidDriver
Failed to load driver specified by the configuration.

Since

3.0
public
# deactivate( )

Deactivates the current session.

Deactivates the current session.

Throws

Core\Exception\Runtime
Another session is currently activate.

Since

3.0
public static string
# generateID( )

Returns a new session identifier.

Returns a new session identifier.

Returns

string
A new session identifier.

Since

3.0
public static Core\Session_Token
# getToken( string $name = null )

Returns a named token for the currently active session.

Returns a named token for the currently active session.

Parameters

$name

Optional. Name of token to return. If no name is specified, the standard session token is returned.

Returns

Core\Session_Token
Requested Session_Token instance.

Throws

Core\Exception\Runtime
No active session to retrieve token for.

Since

3.0
public static string
# id( )

Returns the ID of the currently active session, if any.

Returns the ID of the currently active session, if any.

Returns

string
ID of currently active session or false, if no session is active.

Since

3.0
public static string
# name( )

Returns the name of the currently active session, if any.

Returns the name of the currently active session, if any.

Returns

string
Name of currently active session or false, if no session is active.

Since

3.0
public static string
# parameterID( )

Returns the session name and ID of the currently active session, if any. The session name is appended by an equal sign and the session ID. The string returned can be used as a GET parameter.

Returns the session name and ID of the currently active session, if any. The session name is appended by an equal sign and the session ID. The string returned can be used as a GET parameter.

Returns

string

String formatted »name=id« of the currently active session or false, if no session is active.

Since

3.0
public
# purge( )

Purges all session data and deactivates the session.

Purges all session data and deactivates the session.

Throws

Core\Exception\Runtime
Cannot purge session when session is not active.

Since

3.0

Methods inherited from Core\Set

__get(), __isset()

Methods inherited from Core\Object

__autocreateFactory(), __call(), __processParameters(), __toString(), attachMethod(), chain(), getValueForKey(), getValueForKeyPath(), getValueForUndefinedKey(), hash(), issetValueForKey(), setValueForKey(), setValueForKeyPath(), setValueForUndefinedKey(), uuid()

Constants summary

string CookieDomainParameter

Defines the cookie domain for session cookies.

Defines the cookie domain for session cookies.

Defaults to the php.ini setting »session.cookie_domain«.

Since

3.0
# 'cookie-domain'
string CookieHTTPRestriction

Marks the cookie as accessible only through the HTTP protocol. Therefore scripts and other components may not access the session cookie. Depends on browser support.

Marks the cookie as accessible only through the HTTP protocol. Therefore scripts and other components may not access the session cookie. Depends on browser support.

Defaults to the php.ini setting »session.cookie_httponly«.

Since

3.0
# 'cookie-http-restriction'
string CookieLifetimeParameter

Sets the lifetime for the session cookie. A value of 0 means the cookie is deleted once the browser window is closed.

Sets the lifetime for the session cookie. A value of 0 means the cookie is deleted once the browser window is closed.

Defaults to the php.ini setting »session.cookie_lifetime«.

Since

3.0
# 'cookie-lifetime'
string CookiePathParameter

Defines the cookie path for session cookies.

Defines the cookie path for session cookies.

Defaults to the php.ini setting »session.cookie_path«.

Since

3.0
# 'cookie-path'
string CookieSecurity

If enabled, cookies are only sent over secure connections.

If enabled, cookies are only sent over secure connections.

Defaults to the php.ini setting »session.cookie_secure«.

Since

3.0
# 'cookie-security'
string CookieParameter

Sets the cookie mode.

Sets the cookie mode.

To restrict sessions to only rely on cookies and never use other other means of session ID exchange, set this parameter to Core\Session::RequireCookie. Defaults to Core\Session::RequireCookie.

Since

3.0
# 'cookie'
string RequireCookie

Cookie requirement cookie mode. Verifies that the session ID has been supplied via a cookie.

Cookie requirement cookie mode. Verifies that the session ID has been supplied via a cookie.

Since

3.0
# 'require'
string GcLifetimeParameter

Sets the maximum lifetime for session data entries in the garbage collector.

Sets the maximum lifetime for session data entries in the garbage collector.

Defaults to the php.ini setting »session.gc_maxlifetime«.

Since

3.0
# 'gc-lifetime'
string GcProbabilityParameter

Sets the percentage for garbage collector calls.

Sets the percentage for garbage collector calls.

Defaults to the division of the php.ini settings »session.gc_probability« and »session.gc_divisor«.

Since

3.0
# 'gc-probability'
string IPSecurityParameter

Controls, whether sessions are chained to the client IP address. If enabled, a session becomes invalid once the client IP address changes.

Controls, whether sessions are chained to the client IP address. If enabled, a session becomes invalid once the client IP address changes.

Defaults to false.

Since

3.0
# 'ip-security'
string LifetimeParameter

Sets the session lifetime in seconds. If a session has not been updated within the defined time frame, it becomes invalid.

Sets the session lifetime in seconds. If a session has not been updated within the defined time frame, it becomes invalid.

Defaults to 7200.

Since

3.0
# 'lifetime'
string NameParameter

The name of the session.

The name of the session.

The balue must not contain any special characters. Defaults to »xcs«.

Since

3.0
# 'name'
string RefererCheckParameter

Marks sessions invalid for which the client referrer does not contain this substring.

Marks sessions invalid for which the client referrer does not contain this substring.

Defaults to the php.ini setting »session.referer_check«.

Since

3.0
# 'referer-check'

Constants inherited from Core\Object

AnyParameterType, AutochainParameterType, AutocreateParameterType, BooleanParameterType, CharParameterType, EnumParameterType, IntegerParameterType, RealParameterType, StringParameterType, UserParameterType

Properties summary

protected array $_v_parameters

Associative key-value parameters array.

Associative key-value parameters array.

Since

3.0
#
protected static Core\Session $_activeSession

Reference to currently active session.

Reference to currently active session.

Since

3.0
#

Magic properties

public read-only array $parameters

Session configuration parameters.

Magic properties inherited from Core\Object

$hash, $uuid

xplo.re Medusa Core Framework 3.1 API documentation generated by ApiGen