Session variables are stored using the native support in PHP:
$_SESSION['greeting'] = 'Hello world';
Values stored in the $_SESSION array are passed from the controller to the view in an array with the implied name of $this→params. In the view, you could access the above variable with
{params-greeting}
or
{params-greeting?}
The PHP way of managing sessions (and cookies) is quite straight forward, but you can still use the Request methods from within your controller:
$this->Request->resetSession(); $this->Request->getCookies();
Akelos stores session data in the database in the production and development environments, but in a file in the testing environment. For this reason, some people get permissions problems when doing testing. If you want the session to be stored in the database during testing, you need to add the following line to config.php:
define('AK_SESSION_HANDLER', 1);
Sessions stored in the database will be in a table named “sessions”, with columns of id, expire and value.
If you want to refresh the expire date while the user is active on the web site, keeping the session “alive”, Akelos will handle it for you as long as your session data is changed. It means that if you write the same data in your session, it will not be refreshed. To make certain that the session data is changed, the value of time() can be stored in a session variable.