Introduction
cPanel, WHM, and Webmail maintain user login sessions by storing session files on the server under the /var/cpanel/sessions directory. Over time, these sessions may need to be cleared for troubleshooting, security, or to force re-authentication for all users.
Prerequisites
Before clearing cPanel sessions, ensure the following:
- Root or sudo access to the server
- Basic knowledge of Linux command line
- Awareness that all active sessions will be terminated
- Inform users if the server is in production, since they will be logged out
- Optional: Take a quick backup of session directory (for audit/debug purposes)
Steps to Clear cPanel Login Sessions
Session data for cPanel, WHM, and Webmail is stored on the server under the /var/cpanel/sessions directory. To clear these stored session files, you can manually delete them using the following command:
find /var/cpanel/sessions/{cache,preauth,raw}/ -type f -delete
This command deletes all session files from the respective directories, effectively invalidating all active login sessions.
Conclusion
Clearing cPanel sessions is a quick and effective way to force logout all users and reset authentication states across cPanel, WHM, and Webmail. However, it should be done carefully in production environments, as all active users will be disconnected and required to log in again.