for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Anax\Session;
/**
* Anax base class for wrapping sessions.
*
*/
class CSession
{
use \Anax\TConfigure;
* Construct session.
* @param array $options to configure options.
public function __construct($options = [])
$options
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
;
}
* Set a session name or use one from config.
* @param array $aName to set as session name, default is null and then use name from config.
public function name($aName = null)
$name = isset($aName)
? $aName
: (isset($this->config['name'])
? $this->config['name']
: "anax");
session_name($name);
* Start session.
public function start($options = [])
session_start();
* Get values from session.
* @param string $key in session variable.
* @param mixed $default default value to return when key is not set in session.
* @return mixed
public function get($key, $default = null)
return isset($_SESSION) && isset($_SESSION[$key])
? $_SESSION[$key]
: $default;
* Set values in session.
* @param mixed $value to set in session.
* @return void
public function set($key, $value)
$_SESSION[$key] = $value;
* Check if a value is set in the session.
* @return boolean true if $key is set, else false.
public function has($key)
return isset($_SESSION[$key]);
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.