Welcome Guest, Not a member yet? Register   Sign In
Codeigniter generate session file in each visit
#1

Hey everyone.

I noticed that CI generate session file in each user visit. The session file didn't contain something about user except last session creation about that user.


PHP Code:
__ci_last_regenerate|i:1522498734

Is anybody know why it's created and how to prevent from session file creation on server? It's crazy to realize million of sessions file created on server.
Reply
#2

That's the way sessions work, it will clean up the files after a certain amount of time.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

@exma,

Try reading this: https://www.codeigniter.com/user_guide/l...sions.html
It might be helpful.
Reply
#4

(04-01-2018, 04:27 AM)InsiteFX Wrote: That's the way sessions work, it will clean up the files after a certain amount of time.

Well, here come my issue, the file didn't dropped. They still to be exists on the server. By the time session should to exists 24 hours. After that, the file should to be deleted, but NOT! File still to be exists and if you're using session manipulations methods such as tempdata or set/unset_session only unside content are delete, the file still to be exists. After couple of days I have billion of session file on my server.

[Image: d9aG_fkdR-KCrUOI-gDszg.png]


(04-02-2018, 05:40 AM)php_rocs Wrote: @exma,

Try reading this: https://www.codeigniter.com/user_guide/l...sions.html
It might be helpful.

-_- already did that. Nothing about my issue.
Reply
#5

(This post was last modified: 04-04-2018, 01:54 PM by dave friend.)

Session files (or database entries if you're using that driver) are not immediately deleted when the associated session expires or is closed.
The clean up of these files is called "garbage collection" (GC) and happens only occasionally.
How often depends on some php.ini settings.

This short article will provide background for you.

CodeIgniter relies on PHP's native session garbage collection scheme. If you are interested in creating your own system for GC this article may be of interest.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB