Methods summary
public
|
|
public
Boolean
|
#
start( )
Starts the session storage.
Starts the session storage.
Returns
Boolean True if session started.
Throws
Implementation of
|
public
Boolean
|
#
has( string $name )
Checks if an attribute is defined.
Checks if an attribute is defined.
Parameters
- $name
string $name The attribute name
Returns
Boolean true if the attribute is defined, false otherwise
Implementation of
|
public
mixed
|
#
get( string $name, mixed $default = null )
Returns an attribute.
Parameters
- $name
string $name The attribute name
- $default
mixed $default The default value if not found.
Returns
mixed
Implementation of
|
public
|
#
set( string $name, mixed $value )
Sets an attribute.
Parameters
- $name
string $name
- $value
mixed $value
Implementation of
|
public
array
|
#
all( )
Returns attributes.
Returns
array Attributes
Implementation of
|
public
|
#
replace( array $attributes )
Sets attributes.
Parameters
- $attributes
array $attributes Attributes
Implementation of
|
public
mixed
|
#
remove( string $name )
Removes an attribute.
Parameters
Returns
mixed The removed value
Implementation of
|
public
|
#
clear( )
Clears all attributes.
Implementation of
|
public
Boolean
|
#
isStarted( )
Checks if the session was started.
Checks if the session was started.
Returns
Boolean
Implementation of
|
public
ArrayIterator
|
#
getIterator( )
Returns an iterator for attributes.
Returns an iterator for attributes.
Returns
Implementation of
|
public
integer
|
#
count( )
Returns the number of attributes.
Returns the number of attributes.
Returns
integer The number of attributes
Implementation of
|
public
Boolean
|
#
invalidate( integer $lifetime = null )
Invalidates the current session.
Invalidates the current session.
Parameters
- $lifetime
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.
Returns
Boolean True if session invalidated, false if error.
Implementation of
|
public
Boolean
|
#
migrate( Boolean $destroy = false, integer $lifetime = null )
Migrates the current session to a new session id while maintaining all
session attributes.
Migrates the current session to a new session id while maintaining all
session attributes.
Parameters
- $destroy
Boolean $destroy Whether to delete the old session or leave it to garbage collection.
- $lifetime
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.
Returns
Boolean True if session migrated, false if error.
Implementation of
|
public
|
#
save( )
Force the session to be saved and closed.
Force the session to be saved and closed.
Implementation of
|
public
string
|
#
getId( )
Returns the session ID.
Returns
string The session ID.
Implementation of
|
public
|
#
setId( string $id )
Sets the session ID
Parameters
Implementation of
|
public
mixed
|
#
getName( )
Returns the session name.
Returns the session name.
Returns
mixed The session name.
Implementation of
|
public
|
#
setName( string $name )
Sets the session name.
Parameters
Implementation of
|
public
MetadataBag
|
#
getMetadataBag( )
Gets session meta.
Returns
MetadataBag
Implementation of
|
public
|
|
public
Symfony\Component\HttpFoundation\Session\SessionBagInterface
|
#
getBag( string $name )
Gets a bag instance by name.
Gets a bag instance by name.
Parameters
Returns
Implementation of
|
public
Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface
|
#
getFlashBag( )
Gets the flashbag interface.
Gets the flashbag interface.
Returns
|
public
array
|
#
getFlashes( )
Deprecated
since 2.1, will be removed from 2.3
Returns
array
|
public
|
#
setFlashes( array $values )
Deprecated
since 2.1, will be removed from 2.3
Parameters
|
public
string
|
#
getFlash( string $name, string $default = null )
Deprecated
since 2.1, will be removed from 2.3
Parameters
- $name
string $name
- $default
string $default
Returns
string
|
public
|
#
setFlash( string $name, string $value )
Deprecated
since 2.1, will be removed from 2.3
Parameters
- $name
string $name
- $value
string $value
|
public
Boolean
|
#
hasFlash( string $name )
Deprecated
since 2.1, will be removed from 2.3
Parameters
Returns
Boolean
|
public
|
#
removeFlash( string $name )
Deprecated
since 2.1, will be removed from 2.3
Parameters
|
public
array
|
#
clearFlashes( )
Deprecated
since 2.1, will be removed from 2.3
Returns
array
|