start()
start() : boolean
Starts the session storage.
Throws
- \RuntimeException
if session fails to start
Returns
boolean —True if session started
Interface for the session.
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
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 |
getMetadataBag() : \Symfony\Component\HttpFoundation\Session\Storage\MetadataBag
Gets session meta.