Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

How does cPanel remove session expired files

Discussion in 'General Discussion' started by SysNet, Oct 23, 2017.

  1. SysNet

    SysNet Registered

    Joined:
    Oct 23, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Root
    cPanel Access Level:
    Root Administrator
    Hello there.

    I have tried to find information, of how work session login cpanel. Relation to store files in /var/cpanel/sessions/raw
    /var/cpanel/sessions/cache
    When I login the file is created in /raw and /cache, but when I closet the browser without logout, the file remain in that location.

    My question is, when does whm/cpanel remove session expired files from /var/cpanel/sessions/cache or /var/cpanel/sessions/raw ?

    What script does this task?
    I've seen crontab /var/spool/cron/root but not information relation to delete session cpanel just php

    ¿is possible remove session files expired after 12 hours?

    Note: I'm worried about the issue of inodes
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,367
    Likes Received:
    1,856
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The removal of expired sessions is not a value you can adjust, and is handled directly through cpsrvd. If inodes are a concern, have you checked to see which directories are using the most files? Here's a useful command you can use to check:

    Code:
    cd /
    echo "Inode usage for: $(pwd)" ; for d in `find -maxdepth 1 -type d |cut -d\/ -f2 |grep -xv . |sort`; do c=$(find $d |wc -l) ; printf "$c\t\t- $d\n" ; done ; printf "Total: \t\t$(find $(pwd) | wc -l)\n"
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. SysNet

    SysNet Registered

    Joined:
    Oct 23, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Root
    cPanel Access Level:
    Root Administrator
    Hi there, thanks so much.

    Is after 24 hours the sessions delete?

    Another, Does this code in:

    Code:
    package Cpanel::Config::Session;
    our $SESSION_EXPIRE_TIME      = ( 60 * 60 * 24 ); 
    
    Location: /usr/local/cpanel/Cpanel/Config/Session.pm

    And this others files: /usr/local/cpanel/Cpanel/Session/* (all files from this folder)

    The previous code and all files are there related to cpsrvd, and work together ?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,367
    Likes Received:
    1,856
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The session files associated with a user within /var/cpanel/sessions/raw and /var/cpanel/sessions/cache are automatically removed when the user clicks on the "Log Out" button within cPanel or WHM, or during other actions such as password changes. The files remain if the user simply closes the browser window and chooses to not click on "Log Out". If you wanted to remove the remaining files sooner, then you'd need to setup a cron job to manually remove those files from the corresponding directories. As far as /usr/local/cpanel/Cpanel/Config/Session.pm, that file servers multiple purposes. I don't recommend manually editing this file. Is there a particular concern you have about session management?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice