Session

Class Session

package

Ascmvc\Session

Methods

Session constructor.

__construct(\Ascmvc\Session\SessionManager $sessionManager, \Psr\Cache\CacheItemPoolInterface $sessionCachePool) 
Throws
\Psr\Cache\InvalidArgumentException

Arguments

$sessionCachePool

\Psr\Cache\CacheItemPoolInterface

Session destructor.

__destruct() 

Creates a new session.

createNewSession() 

Generates a new session ID.

generateSessionId() : boolean|string
Throws
\Exception

Response

boolean|string

Gets the session element of data by name.

get(string|null $name = null) : array|mixed|null

Arguments

$name

string|null

Response

array|mixed|null

Gets the session id.

getSessionId() : string|null
Throws
\Psr\Cache\InvalidArgumentException

Response

string|null

Reads the data from the storage.

readData() : boolean
Throws
\Psr\Cache\InvalidArgumentException

Response

boolean

Regenerates an expired session.

regenerateSession() 

Saves the data in the storage.

saveData() : boolean

Response

boolean

Sets the session element of data by name.

set(string $name,  $value) : $this

Arguments

$name

string

$value

Response

$this

Sets the session id.

setSessionId( $sessionId) : null|string

Arguments

$sessionId

Response

null|string

Properties

Contains a SessionManager instance.

sessionManager : \Ascmvc\Session\SessionManager

Contains the session Config object.

config : \Ascmvc\Session\Config

Contains the session Http object.

http : \Ascmvc\Session\Http|null
var

Type(s)

\Ascmvc\Session\Http|null

Contains the session id string.

sessionId : string|null
var

Type(s)

string|null

Contains the session's data.

data : array
var

Type(s)

array

Contains a PSR-6 CacheItemPoolInterface instance.

sessionCachePool : \Psr\Cache\CacheItemPoolInterface|null
var

Type(s)

\Psr\Cache\CacheItemPoolInterface|null

Contains the session's cache item.

sessionCacheItem : \Psr\Cache\CacheItemInterface|null
var

Type(s)

\Psr\Cache\CacheItemInterface|null