Re: freeing resourses after the end of the session
| From: | Wolf | Date: | Mon, 19 Nov 2007 15:36:18 +0000 |
| Subject: | Re: freeing resourses after the end of the session | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-264782@lists.php.net to get a copy of this message | ||
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@opapagaiorinoceronte.net> 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@opapagaiorinoceronte.net
> _____________________________
> www.opapagaiorinoceronte.net
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php