trait SessionCapable (View source)

Provides session-based API communication methods.

Use this trait in SessionClient classes whose underlying API supports persistent sessions (login/logout lifecycle).

Methods

login()

Perform API login to start session-based communication

logout()

Perform API logout to close API session in use

saveSession(array $session)

Apply session data to a PHP session object

reuseSession(array $session)

Rebuild connection settings from a PHP session object

Details

Response login()

Perform API login to start session-based communication

Return Value

Response

Response logout()

Perform API logout to close API session in use

Return Value

Response

SessionCapable saveSession(array $session)

Apply session data to a PHP session object

Parameters

array $session

php session instance ($_SESSION)

Return Value

SessionCapable

SessionCapable reuseSession(array $session)

Rebuild connection settings from a PHP session object

Parameters

array $session

php session object ($_SESSION)

Return Value

SessionCapable