SessionTokenStorage::removeToken()

string|null removeToken(string $tokenId) Removes a CSRF token. Parameters string $tokenId The token ID Return Value string|null Returns the removed token if one existed, NULL otherwise

SessionStorageInterface::registerBag()

registerBag(SessionBagInterface $bag) Registers a SessionBagInterface for use. Parameters SessionBagInterface $bag

SessionStorageInterface::save()

save() Force the session to be saved and closed. This method must invoke sessionwriteclose() unless this interface is used for a storage object design for unit or functional testing where a real PHP session would interfere with testing, in which case it should actually persist the session data if required. Exceptions RuntimeException If the session is saved without being started, or if the session is already closed.

SessionTokenStorage

class SessionTokenStorage implements TokenStorageInterface Token storage that uses a Symfony Session object. Constants SESSION_NAMESPACE The namespace used to store values in the session. Methods __construct(SessionInterface $session, string $namespace = self::SESSION_NAMESPACE) Initializes the storage with a Session object and a session namespace. string getToken(string $tokenId) Reads a stored CSRF token. setToken(string $tokenId, string $token) Stores a CSRF token. b

SessionStorageInterface::setName()

setName(string $name) Sets the session name. Parameters string $name

SessionStorageInterface::setId()

setId(string $id) Sets the session ID. Parameters string $id

SessionStorageInterface::start()

bool start() Starts the session. Return Value bool True if started Exceptions RuntimeException If something goes wrong starting the session.

SessionStorageInterface::getBag()

SessionBagInterface getBag(string $name) Gets a SessionBagInterface by name. Parameters string $name Return Value SessionBagInterface Exceptions InvalidArgumentException If the bag does not exist

SessionStorageInterface::getMetadataBag()

MetadataBag getMetadataBag() Return Value MetadataBag

SessionStorageInterface::regenerate()

bool regenerate(bool $destroy = false, int $lifetime = null) Regenerates id that represents this storage. This method must invoke sessionregenerateid($destroy) unless this interface is used for a storage object designed for unit or functional testing where a real PHP session would interfere with testing. Note regenerate+destroy should not clear the session data in memory only delete the session data from persistent storage. Care: When regenerating the session ID no locking is inv