Re: [PHP] Re: when to delete a temporary file ?
on 7/8/01 11:45 AM, Lasse at [EMAIL PROTECTED] wrote: >> this was the first approach I thought about, but I don't know how to check >> session IDs other that current one I use session_is_registered() to check >> for the current session but how can I check for other sessions ? tell me >> please :) > > Um... I'm not sure... I've never actually used sessions myself.. :-) I just > figured that it would be possible... php session info can be stored a couple differet ways on your server. the default is a file (one for each session) in /tmp. the name of the file includes the session id. http://www.php.net/session -- mike cullerton -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: when to delete a temporary file ?
"Arash Dejkam" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... [SNIP] > this was the first approach I thought about, but I don't know how to check > session IDs other that current one I use session_is_registered() to check > for the current session but how can I check for other sessions ? tell me > please :) Um... I'm not sure... I've never actually used sessions myself.. :-) I just figured that it would be possible... Sounds to me like the best solution for you would be to make your own session-handling routines... This way you'd have complete control over your sessions... -- Lasse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: when to delete a temporary file ?
"Lasse" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > "Arash Dejkam" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Hi, > > > > I've created a site where users can upload photos and specify which other > > users are allowed to view them using PHP session management. now I have > > alittle problem in the post-upload page, script creates a temporary copy > of > > the uploaded image with a name the same as user's session ID, and puts a > > in the page for the user to view the uploaded > photo > > and confirm it. now I don't know when to delete that temporary file ! > > because I don't know how long does the user's browser take to download the > > image. currently I delete it in the script coming up just after user > clicks > > the confirm button, but what if the user close his/her browser before > > clicking the confirm button ? the file remains there for ever !! > > what's your suggestion ? > > Don't your sessions time out BTW? That should make it possible to check for > any temp files whose session isn't alive anymore and delete them. Since the > corresponding session is dead anyway the image can be safely deleted... > > Or am I missing something? > > -- > Lasse > this was the first approach I thought about, but I don't know how to check session IDs other that current one I use session_is_registered() to check for the current session but how can I check for other sessions ? tell me please :) Thanks Arash Dejkam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: when to delete a temporary file ?
"Arash Dejkam" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi, > > I've created a site where users can upload photos and specify which other > users are allowed to view them using PHP session management. now I have > alittle problem in the post-upload page, script creates a temporary copy of > the uploaded image with a name the same as user's session ID, and puts a > in the page for the user to view the uploaded photo > and confirm it. now I don't know when to delete that temporary file ! > because I don't know how long does the user's browser take to download the > image. currently I delete it in the script coming up just after user clicks > the confirm button, but what if the user close his/her browser before > clicking the confirm button ? the file remains there for ever !! > what's your suggestion ? Depending on the sizes of the files, number of users, etc... Do as you do now, and then do a scan of the temp files in one of your scripts and delete any older than a reasonable amount of time... 24 hours for example Don't your sessions time out BTW? That should make it possible to check for any temp files whose session isn't alive anymore and delete them. Since the corresponding session is dead anyway the image can be safely deleted... Or am I missing something? -- Lasse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]