Steve Gattuso Steve Gattuso - 6 months ago 11
PHP Question

Where are $_SESSION variables stored?

Are $_SESSION variables stored on the client or the server?

Answer

The location of the $_SESSION variable storage is determined by PHP's session.save_path configuration. Usually this is /tmp on a Linux/Unix system. Use the phpinfo() function to view your particular settings if not 100% sure by creating a file with this content in the DocumentRoot of your domain:

<?php
    phpinfo();
?>

Here is the link to the PHP documentation on this configuration setting:

http://us.php.net/manual/en/session.configuration.php#ini.session.save-path

Comments