SessionStore
class SessionStore implements StoreInterface, Serializable (View source)
This class provides an interface to store data in session during an MFA process. This is implemented as a measure to prevent bleeding state between individual MFA auth types
Constants
SESSION_KEY |
|
Properties
protected | Member | $member | The member that is currently going through the MFA process |
|
protected | int | $memberID | MemberID is only used on unserialising from session as we can defer the DB call for the member |
|
protected | string | $method | A string representing the current authentication method that is underway |
|
protected | array | $state | Any state that the current authentication method needs to retain while it is underway |
|
protected | string[] | $verifiedMethods | The URL segment identifiers of methods that have been verified in this session |
Methods
Attempt to create a store from the given request getting any existing state from the session of the request
Update the state in the store. Will override existing state. To add to the existing state use addState().
Add and keep track of methods that have been verified
"Reset" the method currently in progress by clearing the identifier and state
The __unserialize() magic method will be automatically used instead of this almost all the time This method will be automatically used if existing serialized data was not saved as an associative array and the PHP version used in less than PHP 9.0
Details
__construct(Member $member)
Attempt to create a store from the given request getting any existing state from the session of the request
{@inheritdoc}
Member|null
getMember()
No description
StoreInterface
setMember(Member $member)
No description
string|null
getMethod()
No description
StoreInterface
setMethod(string|null $method)
No description
array
getState()
Get the state from the store
StoreInterface
setState(array $state)
Update the state in the store. Will override existing state. To add to the existing state use addState().
StoreInterface
addState(array $state)
Add to the state in the store
StoreInterface
addVerifiedMethod(string $method)
Add and keep track of methods that have been verified
array
getVerifiedMethods()
Get the list of methods that have been verified
StoreInterface
save(HTTPRequest $request)
Save this store into the session of the given request
{@inheritdoc}
static StoreInterface|null
load(HTTPRequest $request)
Load a StoreInterface from the given request and return it if it exists
static void
clear(HTTPRequest $request)
Clear any stored values for the given request
{@inheritdoc}
protected StoreInterface
resetMethod()
"Reset" the method currently in progress by clearing the identifier and state
array
__serialize()
No description
void
__unserialize(array $data)
No description
string
serialize()
deprecated
deprecated
The __serialize() magic method will be automatically used instead of this
void
unserialize(string $serialized)
deprecated
deprecated
The __unserialize() magic method will be automatically used instead of this almost all the time This method will be automatically used if existing serialized data was not saved as an associative array and the PHP version used in less than PHP 9.0