General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 11th, 2003, 08:55 AM
Volitics Volitics is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Knoxville, Tennessee (U.S.A.)
Posts: 58 Volitics User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 15 sec
Reputation Power: 6
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."

Reply With Quote
  #2  
Old September 11th, 2003, 09:47 PM
jpenn jpenn is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Washington, DC
Posts: 317 jpenn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 3 sec
Reputation Power: 6
Quote:
"session.gc_maxlifetime specifies the number of seconds after which data will be seen as 'garbage' and cleaned up."

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.




Reply With Quote
  #3  
Old September 11th, 2003, 10:15 PM
Volitics Volitics is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Knoxville, Tennessee (U.S.A.)
Posts: 58 Volitics User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 15 sec
Reputation Power: 6
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

Reply With Quote
  #4  
Old September 12th, 2003, 01:39 AM
jpenn jpenn is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Washington, DC
Posts: 317 jpenn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 3 sec
Reputation Power: 6
Quote:
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 only wish I was too young to remember - I have kids as old as most of the users on this board.

Reply With Quote
  #5  
Old September 12th, 2003, 11:39 AM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Quote:
Originally posted by jpenn

I only wish I was too young to remember - I have kids as old as most of the users on this board.


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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > How Do I Delete "session" File In "tmp" Directory


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway