Session Files and Serialized Data
Look at some details of session storage.
We'll cover the following...
We are going to look into a few non-essential details about session storage now. If you don’t think you need to learn about this, skip to the next lesson where we introduce flash messages.
Viewing stored session data
What does stored session data look like?
Let’s find out by running php -i | grep session
in the Terminal.
You should see a list of PHP settings related to sessions:
Press + to interact
sessionsession.auto_start => Off => Off...session.name => PHPSESSID => PHPSESSIDsession.referer_check => no value => no valuesession.save_handler => files => filessession.save_path => /var/lib/php/sessions => /var/lib/php/sessions
That last value is relevant for us. It says session.save_path
, and the value is /var/lib/php/sessions
.
On your computer, it may be some different directory.
Let’s go to that directory:
cd /var/lib/php/sessions`.
See what’s inside this directory by running ls
.
Press + to interact
ls
If you get an error saying “ls: cannot open directory ‘.’: Permission ...
Access this course and 1400+ top-rated courses and projects.