SessionTrait¶
-
trait
atk4\core\
SessionTrait
¶ Source: vendor/atk4/core/src/SessionTrait.php#5
Properties¶
-
public static property
atk4\core\SessionTrait::$
_sessionTrait
¶ - Check this property to see if trait is present in the object.
Source: vendor/atk4/core/src/SessionTrait.php#12 Type: bool
-
protected static property
atk4\core\SessionTrait::$
session_key
¶ - Session container key.
Source: vendor/atk4/core/src/SessionTrait.php#19 Type: string
Methods¶
-
public
atk4\core\SessionTrait::
startSession
($options=[])¶ - Create new session.
Source: Parameters: - $options (array) Options for session_start()
-
public
atk4\core\SessionTrait::
destroySession
()¶ - Destroy existing session.
Source: vendor/atk4/core/src/SessionTrait.php#49
-
public
atk4\core\SessionTrait::
memorize
($key, $value)¶ - Remember data in object-relevant session data.
Source: Parameters: - $key (string) Key for the data
- $value (mixed) Value
Returns: mixed $value
-
public
atk4\core\SessionTrait::
learn
($key, $default=null)¶ - Similar to memorize, but if value for key exist, will return it.
Source: Parameters: - $key (string) Data Key
- $default (mixed) Default value
Returns: mixed Previously memorized data or $default
-
public
atk4\core\SessionTrait::
recall
($key, $default=null)¶ - Returns session data for this object. If not previously set, then$default is returned.
Source: Parameters: - $key (string) Data Key
- $default (mixed) Default value
Returns: mixed Previously memorized data or $default
-
public
atk4\core\SessionTrait::
forget
($key=null)¶ - Forget session data for $key. If $key is omitted will forget allassociated session data.
Source: Parameters: - $key (string) Optional key of data to forget
Returns: $this