PHP Class Neos\Flow\Session\TransientSession

This session behaves like any other session except that it only stores the data during one request.
Inheritance: implements Neos\Flow\Session\SessionInterface
Exibir arquivo Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$data array The session data
$lastActivityTimestamp integer
$sessionId string The session Id
$started boolean If this session has been started
$tags array

Public Methods

Method Description
addTag ( string $tag ) : void Tags this session with the given tag.
canBeResumed ( ) : boolean Returns TRUE if there is a session that can be resumed. FALSE otherwise
close ( ) : void Closes the session
collectGarbage ( ) : void No operation for transient session.
destroy ( string $reason = null ) : void Explicitly destroys all session data
destroyAll ( Bootstrap $bootstrap ) : void No operation for transient session.
getData ( string $key ) : mixed Returns the data associated with the given key.
getId ( ) : string Returns the current session ID.
getLastActivityTimestamp ( ) : integer Returns the unix time stamp marking the last point in time this session has been in use.
getTags ( ) : array Returns the tags this session has been tagged with.
hasKey ( string $key ) : boolean Returns TRUE if $key is available.
isStarted ( ) : boolean Tells if the session has been started already.
putData ( string $key, object $data ) : void Stores the given data under the given key in the session
removeTag ( string $tag ) : void Removes the specified tag from this session.
renewId ( ) : string Generates and propagates a new session ID and transfers all existing data to the new session.
resume ( ) : void Resumes an existing session, if any.
start ( ) : void Starts the session, if it has not been already started
touch ( ) : void Updates the last activity time to "now".

Method Details

addTag() public method

Note that third-party libraries might also tag your session. Therefore it is recommended to use namespaced tags such as "Acme-Demo-MySpecialTag".
public addTag ( string $tag ) : void
$tag string The tag – must match be a valid cache frontend tag
return void

canBeResumed() public method

Returns TRUE if there is a session that can be resumed. FALSE otherwise
public canBeResumed ( ) : boolean
return boolean

close() public method

Closes the session
public close ( ) : void
return void

collectGarbage() public method

No operation for transient session.
public collectGarbage ( ) : void
return void

destroy() public method

Explicitly destroys all session data
public destroy ( string $reason = null ) : void
$reason string A reason for destroying the session – used by the LoggingAspect
return void

destroyAll() public static method

No operation for transient session.
public static destroyAll ( Bootstrap $bootstrap ) : void
$bootstrap Neos\Flow\Core\Bootstrap
return void

getData() public method

Returns the data associated with the given key.
public getData ( string $key ) : mixed
$key string An identifier for the content stored in the session.
return mixed The data associated with the given key or NULL

getId() public method

Returns the current session ID.
public getId ( ) : string
return string The current session ID

getLastActivityTimestamp() public method

Returns the unix time stamp marking the last point in time this session has been in use.
public getLastActivityTimestamp ( ) : integer
return integer unix timestamp

getTags() public method

Returns the tags this session has been tagged with.
public getTags ( ) : array
return array The tags or an empty array if there aren't any

hasKey() public method

Returns TRUE if $key is available.
public hasKey ( string $key ) : boolean
$key string
return boolean

isStarted() public method

Tells if the session has been started already.
public isStarted ( ) : boolean
return boolean

putData() public method

Stores the given data under the given key in the session
public putData ( string $key, object $data ) : void
$key string The key under which the data should be stored
$data object The data to be stored
return void

removeTag() public method

Removes the specified tag from this session.
public removeTag ( string $tag ) : void
$tag string The tag – must match be a valid cache frontend tag
return void

renewId() public method

Generates and propagates a new session ID and transfers all existing data to the new session.
public renewId ( ) : string
return string The new session ID

resume() public method

Resumes an existing session, if any.
public resume ( ) : void
return void

start() public method

Starts the session, if it has not been already started
public start ( ) : void
return void

touch() public method

Updates the last activity time to "now".
public touch ( ) : void
return void

Property Details

$data protected_oe property

The session data
protected array $data
return array

$lastActivityTimestamp protected_oe property

protected int $lastActivityTimestamp
return integer

$sessionId protected_oe property

The session Id
protected string $sessionId
return string

$started protected_oe property

If this session has been started
protected bool $started
return boolean

$tags protected_oe property

protected array $tags
return array