How to Clear cPanel Login Sessions from the Server

  Uncategorized

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:


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.

LEAVE A COMMENT