ICanBoogie
  • Documentation
  • API Reference
  • ICanBoogie v2.3.0
Namespaces
  • ICanBoogie
    • Autoconfig
    • Core
    • HTTP
      • Dispatcher
    • Session
Classes
  • Core
  • Debug
  • Helpers
  • Logger
  • LogLevel
  • Session
Interfaces
  • LoggerInterface
Traits
  • LoggerTrait
Exceptions
  • AlreadyAuthenticated
  • AuthenticationRequired
  • CoreAlreadyBooted
  • CoreAlreadyInstantiated
  • CoreNotInstantiated
  • PermissionRequired
  • SecurityException

Class Session

Session.

Namespace: ICanBoogie
Located at Session.php

Methods summary

public static exists( void ) : boolean

Checks if a session identifier can be found to retrieve a session.

Checks if a session identifier can be found to retrieve a session.

Returns

boolean
true if the session identifier exists in the cookie, false otherwise.
public static get_session( ICanBoogie\Core $app ) : ICanBoogie\Session

Returns a Session instance.

Returns a Session instance.

The session is initialized when the session object is created.

Once the session is created the start event is fired with the session as sender.

Parameters

$app

Returns

ICanBoogie\Session
public __construct( array $options = [] )

Constructor.

Constructor.

In order to circumvent session fixation and session hijacking, the user agent hash is attached to the session. A previous session can only be restored if the user agent hash match.

The session is destroyed when the values don't match and the "location" header is set to request a reload.

Parameters

$options
protected prepare_options( array $options ) : array

Prepare session options.

Prepare session options.

Parameters

$options

Returns

array
protected apply_options( array $options )

Applies options.

Applies options.

Parameters

$options
protected apply_use_trans_id( $use_trans_sid )

Applies session.use_trans_sid.

Applies session.use_trans_sid.

Parameters

$use_trans_sid
public regenerate_id( boolean $delete_old_session = false ) : boolean|null

Regenerates the id of the session.

Regenerates the id of the session.

Parameters

$delete_old_session

Returns

boolean|null

true when the id is regenerated, false when it is not, null when the application is running from CLI.

public regenerate_token( void ) : string

Regenerates the session token.

Regenerates the session token.

The token_time property is updated to the current time.

Returns

string
The new session token.
public & __get( $property )
public __set( $property, $value )
public __isset( $property )
public __unset( $property )

Properties summary

public static $defaults : array
[

    'id' => null,
    'name' => 'ICanBoogie',
    'domain' => null,
    'use_cookies' => true,
    'use_only_cookies' => true,
    'use_trans_sid' => false,
    'cache_limiter' => null,
    'module_name' => 'files'

]

Magic properties

public $remote_agent_hash : string

The remote user agent hash of the request that created the session.

public $icanboogie_logger : ICanBoogie\Logger
public $token : string

A token that can be used to prevent cross-site request forgeries.

ICanBoogie v2.3.0 – Check on GitHub – API documentation generated by ApiGen