===== Sessions ===== ==== Variable Usage ==== 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. * 'expire' is the time at which the session was created. The session will expire some time later, that time being set in your php.ini. The default is 20 minutes. * 'value' is a longtext on mySQL, so it can hold a maximum of data depending "on the configured maximum packet size in the client/server protocol and available memory" (cf http://dev.mysql.com/doc/refman/5.0/en/string-type-overview.html). Because Akelos writes many things in the session, you can run short of space for data. In case of overflow, the transaction will be canceled, so the session will not be changed at all for the whole page. 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.