$bags
$bags : \Symfony\Component\HttpFoundation\Session\SessionBagInterface[]
Allows session to be started by PHP and managed by Symfony.
$bags : \Symfony\Component\HttpFoundation\Session\SessionBagInterface[]
$started : bool
$closed : bool
$saveHandler : \Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy|\SessionHandlerInterface
$metadataBag : \Symfony\Component\HttpFoundation\Session\Storage\MetadataBag
$emulateSameSite : string|null
__construct(\Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy|\SessionHandlerInterface|null $handler = null, \Symfony\Component\HttpFoundation\Session\Storage\MetadataBag $metaBag = null) : mixed
Depending on how you want the storage driver to behave you probably want to override this constructor entirely.
\Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy|\SessionHandlerInterface|null | $handler | |
\Symfony\Component\HttpFoundation\Session\Storage\MetadataBag | $metaBag |
regenerate(bool $destroy = false, int $lifetime = null) : bool
Regenerates id that represents this storage.
bool | $destroy | Destroy session when regenerating? |
int | $lifetime | Sets the cookie lifetime for the session cookie. A null value will leave the system settings unchanged, 0 sets the cookie to expire with browser session. Time is in seconds, and is not a Unix timestamp. |
setSaveHandler(\Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy|\SessionHandlerInterface|null $saveHandler = null) : mixed
Registers session save handler as a PHP session handler.
To use internal PHP session save handlers, override this method using ini_set with session.save_handler and session.save_path e.g.
ini_set('session.save_handler', 'files');
ini_set('session.save_path', '/tmp');
or pass in a \SessionHandler instance which configures session.save_handler in the constructor, for a template see NativeFileSessionHandler.
\Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy|\SessionHandlerInterface|null | $saveHandler |
loadSession(array $session = null) : mixed
Load the session with attributes.
After starting the session, PHP retrieves the session from whatever handlers are set to (either PHP's internal, or a custom save handler set with session_set_save_handler()). PHP takes the return value from the read() handler, unserializes it and populates $_SESSION with the result automatically.
array | $session |