5.7 Sessions
The CakePHP session component provides a way to persist client data between page requests. It acts as a wrapper for the $_SESSION as well as providing convenience methods for several $_SESSION related functions.
Sessions can be persisted in a few different ways. The default is to use the settings provided by PHP; however, other options exist.
- cake
- Saves the session files in your app's tmp/sessions directory.
- database
- Uses CakePHP's database sessions.
- php
- The default setting. Saves session files as indicated by php.ini
To change the default Session handling method alter the Session.save Configuration to reflect the option you desire. If you choose 'database' you should also uncomment the Session.database settings and run the database session SQL file located in app/config
In views/elements the session can be accessed via the session helper
