Welcome Guest, Not a member yet? Register   Sign In
(Solved) Many session files (112k in 3 days)(admin accessed only by me)
#1
Wink 
(This post was last modified: 03-12-2018, 04:11 PM by lwmirkk. Edit Reason: Solved )

Hi!

I use CI 3.1.2

The system is a private admin that is only accessed by me.

I think the config it is ok....

The system is creating many many session files, look my config:

Code:
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'MYC_session';
$config['sess_expiration'] = 60*60*24*365; // full year;
$config['sess_save_path'] = '/home/MYFOLDER/_sessions/';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = TRUE;

$config['cookie_path']        = '/';
$config['cookie_secure']    = TRUE;
$config['cookie_httponly']     = TRUE;


Thanks a lot.
Reply
#2

(This post was last modified: 03-05-2018, 07:44 PM by php_rocs.)

@lwmirkk,

1st recommendation (assuming it's possible) upgrade CI version to current version.
2nd, config 'sess_expiration' is set wrong. read the documentation (assuming you don't want it to expire).
3rd, I recommend that you read the CI documentation regarding sessions ( https://www.codeigniter.com/user_guide/l...sions.html )
Reply
#3

(03-05-2018, 07:41 PM)php_rocs Wrote: @lwmirkk,

1st recommendation (assuming it's possible) upgrade CI version to current version.
2nd, config 'sess_expiration' is set wrong.  read the documentation (assuming you don't want it to expire).
3rd, I recommend that you read the CI documentation regarding sessions ( https://www.codeigniter.com/user_guide/l...sions.html )

Hi!

Thanks a lot.

1 - Upgraded to the last version to test.
2 - True, the value is not correct, changed to 0.
3 - I changed the default path to a custom path because when in the default path (tmp?), the session expires some hours later, in a custom path, this problem does not occur. I changed to the default path again after the upgrade to test if everithing works fine.

Thanks again. Smile
Reply
#4

Changed to database driver to see if the problem occurs.
A new row is inserted every second with a new session_id each page is accessed (same IP)... It is normal?
my config is:

Code:
$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'my_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'ci_sessions';
$config['sess_match_ip'] = TRUE;
$config['sess_time_to_update'] = 3000;
$config['sess_regenerate_destroy'] = TRUE;
Reply
#5

UPDATE:
It is my fault...
With session lib in autoload the session id is generated each request, but some request is from an App, so the CI recognize each request as a new client and not the same.

Changed the session lib to not autoload and load only when necessary (most part of the time)...
Reply
#6

Hi this issue i have solved by cronjob
Please check this url step by step how to solved this : https://myphpinformation.blogspot.com/se...results=10
Reply




Theme © iAndrew 2016 - Forum software by © MyBB