By default, PHP can store sessions in the filesystem (/tmp).
On shared servers or clusters with multiple nodes, this is unsafe and unreliable.
Attackers with local access may hijack sessions, and customers can experience broken sessions
if load balancer traffic shifts between nodes.
Using a dedicated session backend such as Redis or a database ensures that sessions are consistent, secure, and scalable. It reduces the chance of session hijacking and keeps login and checkout stable.
# Check env.php for session configuration
grep -A3 'session' app/etc/env.php
# Expected: session backend = redis or db, not 'files'
bin/magento info:dependencies:show-modules | grep Session
# Confirm correct storage backend modules are present
env.php:
'session' => [
'save' => 'redis',
'redis' => [
'host' => '127.0.0.1',
'port' => '6379',
'database' => 2
]
]
'session' => [
'save' => 'db'
]
'files' on production, especially in multi-node deployments.# env.php
'session' => [
'save' => 'files'
]
# Session data stored in /tmp → insecure and unreliable
# env.php
'session' => [
'save' => 'redis',
'redis' => [
'host' => '127.0.0.1',
'port' => '6379',
'database' => 2
]
]