I've read about files related to $_SESSION
, but I'd like to find them. Where are they stored?
I've read about files related to $_SESSION
, but I'd like to find them. Where are they stored?
The storage location of the $ _SESSION
variable is determined by setting session.save_path
"of PHP. Typically, the path is /tmp
on a Linux / Unix system.
Use phpinfo()
to see your settings if you are not 100% sure of the location. Just create a .php
file with this code in the DocumentRoot
of your domain:
<?php
phpinfo();
?>
As said in the comments, and also very important to note:
In a simplified way, you can use the
session_save_path()
function that controls this policy .
If you use session_save_path()
, you will be able to simplify finding the storage location of the session variables:
<?php
echo session_save_path();
?>
We also have a question answered about this in our Big Brother SO .
On the server, of course, it would not make sense to keep this control on the client, this information is necessary for the application to maintain some state between requests.