Re: freeing resourses after the end of the session

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Depending on how you are doing the session/image you could do the following:

<?php
// Open the temp folder where sessions are:
// $session_folder
// Open the folder where the temp images are held
// $image_folder
for ($file in $session) { $filename_array[] = $file;}
if ($file in $image != in_array($filename_array)) {unlink($file_in_image);}
?>

Then save that as a cron job that runs every minute or every 5 and (depending on site needs) and you should be good to go.

Wolf
---- Fernando <fernando@xxxxxxxxxxxxxxxxxxxxxxxx> wrote: 
> Hello,
> 
>     I made a image validation code, wich generate a image every time the 
> user enters a page.
> 
>     The name of the image uses the session id, and I save it in a temporary 
> directory.
> 
>     When the user close the browser (or leave the site) I would have to 
> delete the image (or else I will start to have many garbage images in the 
> temp directory).
> 
>     Is there any way to do that? From PHP?
> 
> Fernando Bonafé
> Artista Plástico
> (19) 81184401
> (19) 32322239
> fernando@xxxxxxxxxxxxxxxxxxxxxxxx
> _____________________________
> www.opapagaiorinoceronte.net 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux