NYCPHP Meetup

NYPHP.org

[nycphp-talk] Checking active sessions

David Krings ramons at gmx.net
Mon Apr 30 13:34:07 EDT 2007


Adrian Noland wrote:
>  > Now I get back to the original question, how can I degunk these folders?
>  > I need to know which sessions are still likely to be active and which
>  > ones are not. That all has nothing to do with the temp folder that the
>  > web server creates somewhere for holding the session data. I have no
>  > idea where that temp folder is and if I'd now what happens when I just
>  > dump some files in it (such as the extracted files from the zip
>  > archive). I really like to know where the files and folders are and thus
>  > create/copy/move them on my own.
> 
> Wow.
> No offense, but this sounds like a case of "All I have is a hammer, and 
> everything looks like a nail".

That's a good one! Yes, I think that my approaches are often not what 
one would call "smart", "effective", or "to the book" - but in the end 
they work reliably. I have no professional training as a developer, I 
tried VB, C, Java, Pascal, and several other programming languages and 
IMHO they are all way to complicated for me. OK, I can make something 
happen in VB6, but that's old. PHP is different, maybe because I learned 
it on my own and nobody told me from the start what I have to do to 
prevent going to hell. Some things just have to bite me in the behind a 
few times before I understand what someone would have told me all along 
(comments in source code, initialization of variables, proper naming 
conventions, RTFM, etc.). Still, I'm a hobbyist and do this for fun, a 
few hours per week.

> 
> In a page taken from the ADODB manual: 
> (http://phplens.com/lens/adodb/docs-adodb.htm#cacheflush)
> 
>     If you want to flush all cached recordsets manually, execute the

I'm not flushing any recordsets.

> I use a slightly different line in my crontab:
> @daily find /path/to/tmp/files -mtime +1 -exec rm -rf {} \;

Ah, now I see. Well, that would be one option, but one that wouldn't be 
part of my script and thus not portable that easily. It for sure would 
be faster and not burden the clients. I rather have me remove the mess I 
make than rely on some 3rd party to do the cleanup. I plan on adding 
configurable system settings at some point and may make this optional. 
Someone who doesn't like this can turn it off and do it on their own.

Thanks for the tip.

David





More information about the talk mailing list