|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How Do I Delete "session" File In "tmp" Directory
Description of problem and question about session functionality by session noob:
The "session_start()" function creates a session file that is stored in the "tmp" directory on my hosting server. The session file looks something like this: sess_fd52e0af6f329e84b0b9bfa2f23190a9 I need to somehow automatically delete the session files (like the one above) from the "tmp" directory folder on the server. The PHP Configuration Core page on the server says that the "session.gc_maxlifetime" is set at 1440 for both the Local Value and the Master Value. The PHP Manual says: "session.gc_maxlifetime specifies the number of seconds after which data will be seen as 'garbage' and cleaned up." I'm wondering if the session.gc_maxlifetime setting on my hosting server denotes how many seconds that the session file in the "tmp" directory is supposed to stay there until it expires - or if it means how many seconds the variables will remain until they are "cleaned up" or expire? If it means the number of seconds until the session file in the "tmp" directory will remain there until it expires then it's not working. Session files in the "tmp" directory will remain there indefinitely unless I manually delete them. Does anybody know how I can get the session files in the "tmp" directory to automatically expire without my having to manually delete them? Thanks. Volitics
__________________
Thomas Jefferson: "Democracy will work only until the political incumbents discover they can perpetuate themselves in office by taxing the industrious to bribe the indolent." |
|
#2
|
|||
|
|||
|
Quote:
session.gc_maxlifetime tells the php session gc if it can remove the session file but only if the gc is running. The gc does not run in every call to session start, only on a probability basis. Read the last note at the bottom of this page on GC Probability - http://www.cheetah-soft.com/csh/
__________________
~ Joe Penn We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set? Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you. |
|
#3
|
|||
|
|||
|
Joe;
Thank you for responding to my question. I was working on this same problem several months ago - it was last March to be exact. I couldn't get it figured out six months ago so I decided to start working on another part of my web site. I have just now started to again work on the "sessions" part. You had provided an answer to my problem in an earlier posting six months ago - or so I thought. I was thinking that it was on the DevShed web site forum. This morning I searched through my posts on the DevShed web site and could not find the question. This morning I thought that I must be in the "Twilight Zone" when I could not find the posting (you're probably too young to remember but the Twilight Zone was a scary, 1960's weekly TV serial that was hosted by Rod Serling). I just now did a search on this web site and found the earlier posting. The posting was on this site - not DevShed. http://www.devarticles.com/forum/sh...=&threadid=2956 Thanks again. Volitics |
|
#4
|
|||
|
|||
|
Quote:
I only wish I was too young to remember - I have kids as old as most of the users on this board. ![]() |
|
#5
|
|||
|
|||
|
Quote:
Hehehe... Don't we all wish that! ![]() An even scarier fact: They've brought back the Twilight Zone and modernized it... *shutter*
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > How Do I Delete "session" File In "tmp" Directory |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|