$storage
$storage :
__construct(\Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface $storage = null, \Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface $attributes = null, \Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface $flashes = null)
\Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface | $storage | A SessionStorageInterface instance |
\Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface | $attributes | An AttributeBagInterface instance, (defaults null for default AttributeBag) |
\Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface | $flashes | A FlashBagInterface instance (defaults null for default FlashBag) |
invalidate(integer $lifetime = null) : boolean
Invalidates the current session.
Clears all session attributes and flashes and regenerates the session and deletes the old session from persistence.
integer | $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. |
True if session invalidated, false if error
migrate(boolean $destroy = false, integer $lifetime = null) : boolean
Migrates the current session to a new session id while maintaining all session attributes.
boolean | $destroy | Whether to delete the old session or leave it to garbage collection |
integer | $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. |
True if session migrated, false if error
getMetadataBag() : \Symfony\Component\HttpFoundation\Session\Storage\MetadataBag
Gets session meta.
registerBag(\Symfony\Component\HttpFoundation\Session\SessionBagInterface $bag)
Registers a SessionBagInterface with the session.
\Symfony\Component\HttpFoundation\Session\SessionBagInterface | $bag |
getBag(string $name) : \Symfony\Component\HttpFoundation\Session\SessionBagInterface
Gets a bag instance by name.
string | $name |
getFlashBag() : \Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface
Gets the flashbag interface.
getAttributeBag() : \Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface
Gets the attributebag interface.
Note that this method was added to help with IDE autocompletion.