The Session module provides a session tracking and session storage mechanism.
When using the Session module, each visitor to your web app is assigned a random and secure unique identifier, and you'll be able to keep track of their activity across requests, and store visitor-specific data.
The most obvious use of a session mechanism like this is to implement a login system to let your users identify themselves with some sort of password, and give them access to their private sections and functionalities. This is exactly what the Login module does using Session.
But you can use the Session module for many other purposes. Let's see how.
Setting up the Session database table
The Session module uses the cherrycake_session table in the database to store the sessions information.
You can create the Session table in your database by importing the session.sql file you'll find in the Cherrycake skeleton repository, under the install/database directory.
Because Session needs a connection to a database, you need to set it but by creating a /config/Database.config.php file just like we did in the Database guide.
Working with Session
First, let's remember our simple Hello world web app, which worked with this basic HelloWorld app module: