Class Session
This trait is used to manage the user's sessions. It's declared as trait
to be used in custom classes developer could want to develop to extend
the session management (manage licences, number of simultaneous connections, ...)
-
Hawk\Singleton
-
Hawk\Session
Methods summary
public
|
#
init( )
Initialize the session user
Initialize the session user
|
public
Hawk\User
|
#
getUser( )
Get the user of the current session
Get the user of the current session
Returns
|
public
boolean
|
#
isLogged( )
Returns if the current user is logged or not
Returns if the current user is logged or not
Returns
boolean true if the user is logged, else returns false
|
public
boolean
|
#
isAllowed( string $action )
Check if the user is allowed to make action
Check if the user is allowed to make action
Parameters
- $action
- The name of the permission to check
Returns
boolean True if the user is allowed to perform this action, False in other case
|
public
|
#
setData( array $name, mixed $value )
Set data in session
Parameters
- $name
The variable name to set in the session.
To set a parameter in a sub array, type 'index1.index2'.
For example, to set the parameter $data['user']['name'], type 'user.name'
- $value
- The value to set
|
public
|
#
getData( string $name = null )
Get session data
Parameters
- $name
- The variable name to get in session. For a multidimentionnal data, write 'level1.level2'
|