I have developed a script that starts a session whenever a user (whether logged in or not) comes to the site, so if 100,000 unique people come to site, 100,000 sessions are generated.
I am using a session based redirection system so that when every time a page loads, a new session variable is created (inside session array) without deleting or unsetting the previous one. That new variable contains the URL of current page.
This redirection system is perfect in solving my needs, but now I am curious about side effects.
The script is excessively (but not unnecessarily) creating session variables on each page, so that one unique visiter after 100 page visits has 100+ session variables in his session.
The problem is that mostly users leave the site without any clue and without logging off (if logged in). This keeps the sessions and sessions variable untouched and a lot of precious disk space may be left occupied when heavy strings (like URLs) are saved in sessions.
I want to delete these sessions periodically (say after exactly 10 days of creating session), so that only latest sessions are left on the disk. Can you please tell me how to do this?
Can someone provide me possible solution like modifying php settings, or using CRONJOBS (script).
Or give me an alternative suggestions?
I am using a session based redirection system so that when every time a page loads, a new session variable is created (inside session array) without deleting or unsetting the previous one. That new variable contains the URL of current page.
This redirection system is perfect in solving my needs, but now I am curious about side effects.
The script is excessively (but not unnecessarily) creating session variables on each page, so that one unique visiter after 100 page visits has 100+ session variables in his session.
The problem is that mostly users leave the site without any clue and without logging off (if logged in). This keeps the sessions and sessions variable untouched and a lot of precious disk space may be left occupied when heavy strings (like URLs) are saved in sessions.
I want to delete these sessions periodically (say after exactly 10 days of creating session), so that only latest sessions are left on the disk. Can you please tell me how to do this?
Can someone provide me possible solution like modifying php settings, or using CRONJOBS (script).
Or give me an alternative suggestions?
