Quick Adjustment (2 Minutes)

Default: cPanel sessions timeout after 15-30 minutes of inactivity

1. Increase Timeout via WHM

For all accounts on server:

# Login to WHM
# Navigate to:
Home → cPanel → Session Preferences

# Adjust:
- Session Idle Timeout: 1800 (30 minutes)
- Session Absolute Timeout: 7200 (2 hours)
- Session Persistence: Enable for better UX

2. Per Account Settings

If you don't have WHM access:

# Create .htaccess in home directory:
nano /home/username/.htaccess

# Add these lines:
<IfModule mod_env.c>
    SetEnv CPANEL_SESSION_TIMEOUT 3600
    SetEnv CPANEL_SESSION_ABSOLUTE_TIMEOUT 14400
</IfModule>

Advanced Configuration

1. Modify cPanel Configuration

# Edit cPanel session configuration:
nano /var/cpanel/cpanel.config

# Add or modify:
session_timeout=3600
session_absolute_timeout=14400
session_gc_maxlifetime=7200

# Apply changes:
/usr/local/cpanel/bin/rebuild --update

2. PHP Session Settings

If using PHP applications:

# In php.ini:
session.gc_maxlifetime = 14400
session.cookie_lifetime = 14400

# In .user.ini (cPanel):
session.gc_maxlifetime = 14400
session.cookie_lifetime = 14400

Security Considerations

Timeout Setting Recommended Value Security Level
Idle Timeout 1800 seconds (30 min) Medium
Absolute Timeout 14400 seconds (4 hours) Medium-High
PHP Session Timeout 7200 seconds (2 hours) Medium
Remember Me Cookie 604800 seconds (7 days) Low (for trusted devices)

Troubleshooting

1. Check Current Settings

# Check current timeout values:
grep -i timeout /var/cpanel/cpanel.config
grep -i session /var/cpanel/cpanel.config

# Check PHP settings:
php -i | grep -i session

2. Clear Session Files Manually

# Remove old session files:
cd /var/cpanel/sessions
find . -type f -mmin +60 -delete

# For PHP sessions:
cd /tmp
find . -name "sess_*" -mmin +120 -delete
Success: Session timeout extended. Balance security with convenience based on your needs.