Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 28th, 2003, 09:31 AM
gkb gkb is offline
Registered User
 
Join Date: Jul 2003
Location: yong peng, johor, Malaysia.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to gkb
Default garbage collection can't work?

the pro php4 book had mention that we can use user defined session function as a replace of pre-defined session methods, that is implement session in mysql database.
but the problem is the garbage collection will not function at even i had set the lifetime collectly.
i read a article from www.phpbulder.com that we should call the session grabage collection function after session_start() and before any use of session variable.but why the grabage collection function won't work itself as usual? what is the actual problem?

thanx!

Reply With Quote
  #2 (permalink)  
Old July 31st, 2003, 02:06 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What article on PHPBuilder said to explicitly call the garbage collector?

The garbage collection function simply cleans things up by deleting old, expired session data. There should be no reason to call this function in your script as it's only purpose is to free up dead space. The session data that WOULD be deleted should be marked as expired anyway, so those sessions should NOT be open-able or activated by your script.

When writing custome session handlers and storing session data in a database, the garbage collection function should be a simple query similar to the following:

$query = "DELETE FROM session_data WHERE expires < " . time();


Take care,

Nik
http://www.bigaction.org/
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Garbage Collection azizur123 .NET Framework 2.0 1 February 3rd, 2008 11:16 AM
Garbage collection in VC++ chandugsekhar BOOK: Beginning Visual C++ 6 0 October 18th, 2006 12:09 PM
Garbage Collection Survey S.Marion General .NET 1 June 7th, 2005 12:46 PM
Garbage Collection... kk_katepally General .NET 1 December 21st, 2004 04:18 AM



All times are GMT -4. The time now is 11:17 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.